Question

I'm getting an OutOfMemory: PermGen space error when running my application. A brief description:

The error does not occur when running from the source code, but it does occur when I run from the deployed .jnlp launcher. The error occurs in a screen that retrieves data from our company database via RMI. Running from the source code and from the launcher both use the same RMI url. Running from the source code and from the launcher both use the same Java version (6_38). The app is hosted in OC4J 10.1.3. When the error occurs, it kills not only my app, but also the Java console.

I've added the below options to the server properties in the Application Sever Control, as suggested in some other questions, but to no avail.

-XX:+CMSClassUnloadingEnabled
-XX:+CMSPermGenSweepingEnabled

The error as recorded in the java console is as such, taken from the trace file:

Couldn't process record:
java.lang.OutOfMemoryError: PermGen space
    at sun.misc.Unsafe.defineClass(Native Method)
    at sun.reflect.ClassDefiner.defineClass(Unknown Source)
    at sun.reflect.MethodAccessorGenerator$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at sun.reflect.MethodAccessorGenerator.generate(Unknown Source)
    at sun.reflect.MethodAccessorGenerator.generateSerializationConstructor(Unknown Source)
    at sun.reflect.ReflectionFactory.newConstructorForSerialization(Unknown Source)
    at java.io.ObjectStreamClass.getSerializableConstructor(Unknown Source)
    at java.io.ObjectStreamClass.access$1500(Unknown Source)
    at java.io.ObjectStreamClass$2.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.io.ObjectStreamClass.<init>(Unknown Source)
    at java.io.ObjectStreamClass.lookup(Unknown Source)

I'm not sure what other info might be helpful, and I'm at a loss as to how to continue. Any guidance would be welcome.

Was it helpful?

Solution 2

try first to increase your perm size as the default value is usually too low (for 64bit jvms mainly).

the arguments needed are -XX:PermSize and -XX:MaxPermSize

a max value of 256M is usually enought.

OTHER TIPS

If you have ClassLoader/PermGen leaks in a web application you can get rid of them using the ClassLoader Leak Prevention library.

In case you want to track down leaks yourself this blog series will be of help.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top