Community
Participate
Working Groups
The call to finalize() in CompilationUnitDeclartion performs no function, but is very bad for performance. We've seen this class holding on to 230+ MB of memory after use. http://www.ibm.com/developerworks/java/library/j-jtp01274.html - this document in the section "Finalizers are not your friend" provides a good overview of why the finalize() method is bad. Remove it.
Created attachment 168832 [details] patch
* Explain why you believe this is a stop-ship defect. Or, if it is a "hotbug" (requested by an adopter) please document it as such. CompilationUnitDeclarations are created whenever we need to parse/validate each source file. For larger projects and workspaces this can cause large numbers of these objects, which themselves can be large, to be queued up awaiting their finalize() method to be called by the garbage collector. It's not difficult for this to cause CPU and memory usage to spike unpleasantly. * Is there a work-around? If so, why do you believe the work-around is insufficient? No, the existence of the method itself is the problem. * How has the fix been tested? Is there a test case attached to the Bugzilla record? Has a JUnit Test been added? Measured using profiling tools. * Give a brief technical overview. Who has reviewed this fix? I've reviewed it. * What is the risk associated with this fix? Zero. The method being removed is empty.
for heavens sakes ... how'd this happen? No need to answer :) just glad it was found and fixed.
Patch checked in.