Java PermGen out of memory exception


F

fredliu

Hi,

I'm getting the PermGen exception from our web service. Just want to check other than analyzing through memory tools, are there any known bad practices which may cause PermGen memory leak? Thanks

The code of the sevlet
https://cs.corp.google.com/#piper//...acesaver/web/nanny/BookingRemoverServlet.java

I've bumped up the memory size but the issue still exists.
"-XX:MaxPermSize=160m",

E0327 16:52:17.790999 56 GSE worker #22 HttpConnectionImpl.run caught a throwable
java.lang.OutOfMemoryError: PermGen space
at java.lang.ClassLoader.defineClass(ClassLoader.java:795)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:427)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.ja
 
Ad

Advertisements

A

Arne Vajhøj

I'm getting the PermGen exception from our web service. Just want to check other than analyzing through memory tools, are there any known bad practices which may cause PermGen memory leak? Thanks

The code of the sevlet
https://cs.corp.google.com/#piper//...acesaver/web/nanny/BookingRemoverServlet.java

I've bumped up the memory size but the issue still exists.
"-XX:MaxPermSize=160m",

E0327 16:52:17.790999 56 GSE worker #22 HttpConnectionImpl.run caught a throwable
java.lang.OutOfMemoryError: PermGen space
at java.lang.ClassLoader.defineClass(ClassLoader.java:795)

PermGen is used for classs definitions.

If you are leaking it then it is often because you are dynamically
generating classes and loading them continuously.

But maybe you are not leaking but just need a lot.

160 MB is not that much. You could try with 300 MN and see if the app
can keep running.

Arne
 
Ad

Advertisements

J

Jeff Higgins

On 3/28/2014 11:04 PM, Jeff Higgins wrote:

Hmm.

I thought that permgen was gone in Java 8??
? According to JEP 122 removing the permgen space was a funded project.
Maybe that didn't extend to updating the documentation.
 
Ad

Advertisements


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top