Bookmark Topic Watch Topic
  • Mark post as helpful
  • send pies
  • Report post to moderator
How can you help the garbage collector?

By explicitely nulling references? By explicitely calling System.gc()? By reusing objects instead of instantiating new ones?

Interestingly, with modern JVMs (starting with Java 1.2), the answer to all the above questions is "no" in general - these "solutions" are more likely to do harm than to really help.

see "Java theory and practice: Garbage collection and performance": http://www-106.ibm.com/developerworks/library/j-jtp01274.html?ca=drs-j0504
 
It is sorta covered in the JavaRanch Style Guide.
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!