[jdom-interest] Re:JDOM and Garbage Collection

mark.stephens at ukonline.co.uk mark.stephens at ukonline.co.uk
Wed Sep 18 09:48:31 PDT 2002


On Wednesday 18 Sep 2002 4:03 pm, Xiaozheng Ma wrote:
> At 00:09 2002-9-18 -0600, you wrote:
> >JDOM and Garbage Collection (PJ.Fanning at polarlake.com)
>
> 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!

Java still has memory leaks both caused by the language and the JVM. If the
JVM is coded in C/C++ and they have memory leaks, there must exist the
possibility of the JVM leaking!

One of the classic java leaks is where objects get referenced in a data
structure but not destroyed in something like a user-stack. You can also set
objects to null if they are not implicitly de-referenced.

System.gc is a request to the garbage collector to run now rather than as a
background thread and it will not free up memory if it can't deallocate the
objects....

Can you write a program which consistently produces the leak so it can be
analysed?

MArk




More information about the jdom-interest mailing list