• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Total Loaded Classes is Increasing During Runtime according to JVisualVM

 
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi guys, I am having an Exception in thread thread_name: java.lang.OutOfMemoryError: Compressed class space

During runtime. I already check all my classes and methods used but cannot find what causes it. Later I found out about jvisual vm and tried to open it. I notice that when my tomcat is running,

my total loaded classes only keeps increasing. I'm not sure if is it normal? Sometimes it reaches 1.8gb. I am attaching a screenshot for this.

Can someone please give their opnions please. TIA
screenshot_jvm.png
[Thumbnail for screenshot_jvm.png]
 
Rancher
Posts: 1093
29
Netbeans IDE Oracle MySQL Database Tomcat Server C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is it normal? Depends on your application doesn't it?

If you are not properly dereferencing your objects when you are preparing them for GC, then that is bad: you will never have your GC run to clear our your old objects because they are all still referenced.

So without seeing anything about your application, I would have to say that because you are getting undesired results, that is bad. You have some work to do to see if it is "normal" or not.
 
Matt Taylor
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I really not sure what to do next. I rechecked all my method but my application is getting "Exception in thread "commons-pool-EvictionTimer" java.lang.OutOfMemoryError: Compressed class space" after almost 2 hours of running.

I attach here the graph according to jvisual. I notice that it is not on the heap part that is the problem as I only used 606Mb when I have alloted 2Gb max heap size. The only thing i observe is the total class loaded which is high (3.6M loaded classes) while unloaded classes are only 1k. Part of my program invokes a new instance of SOAP webservice classes (uses a third party api) in a for loop. It is required and I need to invoke it. Not sure if that causes it.
Exception-in-thread-commons-pool-EvictionTimer-java.lang.OutOfMemoryError-Compressed-class-space.png
[Thumbnail for Exception-in-thread-commons-pool-EvictionTimer-java.lang.OutOfMemoryError-Compressed-class-space.png]
 
Les Morgan
Rancher
Posts: 1093
29
Netbeans IDE Oracle MySQL Database Tomcat Server C++ Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Matt,

Monitor what is happening in that "for loop" and see if it is invoked enough to account for the 3.6M classes. There is where I would start looking. If it is, then you are going to have to find some way of refactoring to avoid that, and if you cannot a call to the support line for the product you are using cold be in order.
[edit]
Once again, I cannot answer if that is normal or not for your application for it to grow like that. I am assuming not. You could also increase the stack space -Xss option for Java, but it is sounding like you are trying to say that you expect it is growing beyond all bounds--that is a problem where refactoring is required.
[/edit]
Les

Matt Taylor wrote:I really not sure what to do next. I rechecked all my method but my application is getting "Exception in thread "commons-pool-EvictionTimer" java.lang.OutOfMemoryError: Compressed class space" after almost 2 hours of running.

I attach here the graph according to jvisual. I notice that it is not on the heap part that is the problem as I only used 606Mb when I have alloted 2Gb max heap size. The only thing i observe is the total class loaded which is high (3.6M loaded classes) while unloaded classes are only 1k. Part of my program invokes a new instance of SOAP webservice classes (uses a third party api) in a for loop. It is required and I need to invoke it. Not sure if that causes it.

 
Rancher
Posts: 4801
50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Looking at that second screenshot, your class loading levels out.
That's expected in any Java app.

How big is the SOAP model you are using?
 
Matt Taylor
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
@Dave Tolls

On the second screenshot, when the graph "level out" is also the time my program stops and I receive a Exception in thread "commons-pool-EvictionTimer" java.lang.OutOfMemoryError: Compressed class space
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is the SOAP library using JAXB for XML marshalling?
Perhaps this could be the issue: https://stackoverflow.com/questions/33255578/old-jaxb-and-jdk8-metaspace-outofmemory-issue
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic