'automatic garbage' collection versus system.gc()
843811Oct 18 2001 — edited Oct 23 2001I 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.