[jdom-interest] JDOM Document size

Paul Libbrecht paul at mathweb.org
Sat Feb 10 00:12:22 PST 2001


So... between the local variables (sort of) that are taken care of 
properly by HotSpot and the long-waiting System.gc() there's no 
middle ???

What if the call to System.gc() realizes all threads are waiting, or 
sort of, will it indeed gc ?

Paul



>on 2/8/01 6:44 PM, Jason Hunter at jhunter at collab.net wrote:
>
>>  That approach suffers from the problem that all temporary objects
>>  created during the build will be represented despite the fact they're
>>  not in the document.  You might try a System.gc() but we've found here
>>  before that it doesn't really do a full gc, if it does a gc at all.
>>  (Testing on JDK 1.2.2 Windows shows System.gc() does nothing.)
>
>System.gc() is only a *hint* to the garbage collector that it might find
>right now to be a good time to do garbage collection. If it doesn't find
>anything to collect, or decides that it's not worth its time to collect it,
>then it won't. Typically the 1.2 collector won't kick in unless memory
>allocation is getting tight. Until then it would rather see the system give
>more precedence to running than to memory consumption.
>
>Hotspot of course generates much less "sticky" garbage due to the nursery
>and the fact that very few temporary objects will ever exist in a state
>where the GC will ever see them.




More information about the jdom-interest mailing list