• 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:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

Too many class loaders?

 
Mark Williams
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
At work I ran across an interesting problem for the first time and I am perplexed as to how I should respond.

We have a large Java application running on IBM's JDK 1.5. IBM's JDK has a default setting for the maximum number of class loaders that can exist which is 8192. If this threshold is reached, the JVM will throw and out of memory exception.

Our application threw this exception after running for several days. No big deal I thought. So I doubled the maximum to from 8192 only to find that our application reached the new maximum after a two weeks.

Now, I don't think it would be normal for the application to run for this long in a production environment but I am worried that this might be a symptom of a more fundamental problem in the application. Are there any suggestions for analyzing this problem? Is there some way I can get Java or a debugger to show all of the class loaders present in the JVM? Any other ideas?

Also, this application runs on either Websphere or Tomcat. We are only experiencing this issue when running on Websphere. And we have only one deployment that seems to be affected.

Thanks!
 
Alessandro Zabaroni
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Mark. I'm experiencing the same issue. Websphere application running on jvm 1.6
Did you solve that ?
 
Mark Williams
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Alessandro Zabaroni wrote:Hello Mark. I'm experiencing the same issue. Websphere application running on jvm 1.6
Did you solve that ?



In our case, our application had several thousand threads that were getting started. Fortunately, these threads ended up not being needed for several reasons. When we got rid of the unneeded threads, we never experienced the problem again.

The bad news is that we never definitively proved the root cause. The problem went away once we reduced the number of threads so we just moved on with life.
Is there anything unusual about your application?
 
Alessandro Zabaroni
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Nothing in particular actually.
Could not really guess what the issue is also because I do not know the CloassLoader behaviour in deep.
I can only immagine it could be related to the object that are stored in session.
Even if we deal with 50 session simultaneously more or less.
Regarding threads, we not starting many threads as you were.
We are experiencing native Out of Memory and after trying different solutions I noticed this value in the javacore.txt file.
We were having >8000 classloaders and each time the OOM occured, that number was around 8k.

Moreover, after reducing heap size, that number got past 9k.

So I'd like to understand what's casuing this.
reply
    Bookmark Topic Watch Topic
  • New Topic