Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

The number of the unloaded classes keeps on growing

 
Benjamin Chu
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is you heap size getting close to the amount allotted?
If not, garbage collection (GC) won't run.
 
Benjamin Chu
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic