Skip to Main Content

Java HotSpot Virtual Machine

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

'automatic garbage' collection versus system.gc()

843811Oct 18 2001 — edited Oct 23 2001
I have a long running Java application. Each iteration is triggered by an external event. At the beginning of each iteration a custom class loader is used to bring the class that the application needs for this iteration.

Each time the class loader is invoked memory usage increases. This however, seems to be permament; the application seems to have a serious memory leak. Even hours after I stop sending events that trigger the application to load the next set of classes and run, the memory is not returned.

However, if I place a System.gc() call just before each new iteration, the memory is freed; the leak is gone.

Is there a scenario in which memory will NOT be released unless System.gc() is invoked?

Thanks.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 20 2001
Added on Oct 18 2001
14 comments
654 views