[jdom-interest] Re:JDOM and Garbage Collection

Xiaozheng Ma xzma at iastate.edu
Wed Sep 18 08:03:00 PDT 2002


At 00:09 2002-9-18 -0600, you wrote:
>JDOM and Garbage Collection (PJ.Fanning at polarlake.com)

 >I have an application that uses a mix of reusable components, some written
 >in SAX and some in JDOM. I have noticed that there is a significant memory
 >leak and I suspect that once I have finished with a JDOM Document, that the
 >Garbage Collector is not reclaiming all the available memory. JProbe seems
 >to back up this assertion.
 >I am thinking of going recursively through each JDOM Document when I finish
 >with it and setting the content at each level to null.
 >Has anyone come across a similar problem or have any thoughts on what I
 >should do?

Since JDOM is written in Java, I'm wondering what do you mean "memory leak" 
if your assertion is correct. Java gc should be able to collect memory 
garbage  after you force each used reference to null. Please try call

System.gc();

at the point you want and see if this can ease the memory stress by forcing gc.

Hope this helps!

--
Xiaozheng






More information about the jdom-interest mailing list