• 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

PerGen Space

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello everybody
I have a problem with JBoss, that is: I did deploy a project and after a
few hours of execution (without new deploy) I have "Java.lang.OutOfMemoryError: PermGen space".
Why garbgage collector does not succeed in deallocate memory? What may be the problem?

Do you think that it could be a good idea to set to null all the variables of all the methods of all
the classes of the project in a finally block? (in this case, is there a tool that allow me to do this
automatically?).

Thank you everybody for your attention!
 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
While it's possible that you are legitimately running out of PermGen space and need to increase it, this error usually indicates some sort of memory leak, in my experience.

Start by bumping up your PermGen space to see if the problem persists, even with a larger PermGen (-XX:PermGen and -XX:MaxPermSize). If you still run into the error, start looking for your leak. I suggest using jmap to generate details about the contents of PermGen. You may see something obvious. For example, I ran into this problem a few months ago. Running jmap showed that PermGen was filling up with GroovyClassLoader instances. Each one was listed as having the JBoss UCL as its parent classloader, and each one was marked as "dead," but they weren't being collected. Turns out it was a "classloader leak." When the GroovyClassLoader was constructed in our code, we were passing it the parent classloader (i.e. the JBoss UCL). This resulted in JBoss storing a reference to each GroovyClassLoader that was constructed with the JBoss UCL as its parent. Changing our code to construct the GroovClassLoader instances without a parent classloader solved the problem.

If you have a leak, it's probably something similar. Somewhere, a reference to your objects is being retained, so they're not being collected. Profiling should lead you to the answer. Good luck!
 
John Ulix
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you for your answer, I will try to do what you suggest!
 
John Ulix
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello, I am usingo local the instrument suggested by you, and I can see that the heap space is rightly cleaned by GC, while the permgen space only gorws and never decreases. I did run jmap -dump:file=d.dump on my pc, where the applications runs on locahost. On the computer where the application is finally deployed I have, with the same command, the error:

"not enough storage is available to process this command"

Did it ever happen to you? 21 GB are free on the HD!

Thank you again

 
Jason Cone
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No, I didn't run into that issue. I'd try:

jmap -permstat <pid>

Where <pid> is your process I.D. You're more interested in the permanent generation info than the heap info.
 
I don't always make ads but when I do they're tiny
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic