| 1. | Even so , would explicitly nulling that variable improve performance 即使如此,显式地赋空变量能够提高性能吗? |
| 2. | For correctly scoped variables , there is no benefit . but let s look at another version of the 对于在正确的作用域中的变量来说,显式地赋空变量的确没用。 |
| 3. | The whole discussion is further extended in the article " nulling variables and garbage collection " see 更加深入的讨论请参见“赋空变量和垃圾收集”这篇文章。 (参见 |
| 4. | For example , if a run - time error occurs because of an empty variable , you can check the value of a variable 例如,如果因为一个空变量而出现一个运行时错误,您可以检查变量的值。 |
| 5. | Nulling a variable is simply explicitly assigning null to the variable , as opposed to just letting references go out of scope 赋空变量是指简单地将null值显式地赋值给这个变量,相对于让该变量的引用失去其作用域。 |
| 6. | Variable just after the method completes . so if the jvm does the equivalent of the nulling for you , how can explicitly nulling a variable ever help 既然java虚拟机可以执行等价于赋空的操作,那么显式地赋空变量还有什么用呢? |
| 7. | Staying on the subject of garbage collection , one really fascinating discussion concerned whether there was a performance advantage to explicitly nulling variables 一谈到垃圾收集这个主题,总会涉及到这样一个吸引人的讨论,即显式地赋空变量是否有助于程序的性能。 |
| 8. | Although explicitly nulling variables should normally have no effect , there are also pathological examples where it could have a significant negative effect on performance 虽然显式赋空变量一般应该没有影响,但总有一些反面的例子证明这样做会对性能产生巨大的负面影响。 |
| 9. | Without the explicit null assignment , if the object being created is large enough , then eden gets full and the garbage collector cannot reclaim the currently referenced object 如果没有显式地赋空变量,而且所创建的对象足够大,那么eden就会填满,并且垃圾收集器就不能收集当前所引用的这个大型对象。 |