This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Hello! now I use the jconsole to monitor the tomcat and the web applications running on it! However, I found that the number of the total loaded classes is growing linearly and actually it is because the number of the unloaded classes is increasing. The number of the current loaded classes remains the same. I also use the command " jstat -class pid" and it shows the same result. Is this situation some kind of the 'memory leak' and how to solve this problem? Thanks! [ May 15, 2006: Message edited by: Bear Bibeault ]
Hello! Thanks for the reply! I monitored my heap size which is almost around 15 Mb and I used the default setting for the heap size allocation (64 mb). Does that mean that the GC wont run? Thank you very much!
Java's garbage collection is designed not to run until it absolutely needs to. This is a good thing because gc is a very expensive operation.
Try running your app over time or try creating a test that will create and destroy lots of objects and run it until your heap space gets close to the amount allocated. Once GC runs, you should see a drop in the number of objects hanging around.
Joined: May 15, 2006
ok! I will try to do some test to see what the GC is doing! Thank you very much for the answer! I am appreicating your help!