| Author |
The number of the unloaded classes keeps on growing
|
Benjamin Chu
Greenhorn
Joined: May 15, 2006
Posts: 3
|
|
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 ]
|
 |
Ben Souther
Sheriff
Joined: Dec 11, 2004
Posts: 13410
|
|
Is you heap size getting close to the amount allotted? If not, garbage collection (GC) won't run.
|
Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
|
 |
Benjamin Chu
Greenhorn
Joined: May 15, 2006
Posts: 3
|
|
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!
|
 |
Ben Souther
Sheriff
Joined: Dec 11, 2004
Posts: 13410
|
|
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.
|
 |
Benjamin Chu
Greenhorn
Joined: May 15, 2006
Posts: 3
|
|
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!
|
 |
 |
|
|
subject: The number of the unloaded classes keeps on growing
|
|
|