IBM Support

Xnoclassgc may result in OutOfMemoryError or JVM Crash

Troubleshooting


Problem

Attempts to use -Xnoclassgc option in IBM WebSphere Application Server result in the java.lang.OutOfMemoryError or GPF

Symptom

The -Xnoclassgc option turns off garbage collection of Java classes. This argument results in more class reuse and slightly improved performance. However, the resources owned by these classes(native memory) remain in use even when the classes are not being called.

With the heavy use of application class loaders or with a long running process, it might effectively create a native memory leak of class data, and cause the JVM to throw java.lang.OutOfMemoryError or GPF in the native_stderr.log or javacore file:

native_stderr.log:
JVMDUMP006I Processing dump event "systhrow", detail "java/lang/OutOfMemoryError" - please wait.

javacore:
1TISIGINFO Dump Event "gpf" (00002000) received
2CIUSERARG -Xnoclassgc

To determine if the problem is related to the high number of classes check the javacore file to see how many classes are loaded. For example the below example shows that currently there are over a million classes that are loaded which is a high number and could end up utilizing more native memory.

    Number of classes       1,196,430

More info on the Xnoclassgc parameter is provided in the info center at:

Java virtual machine settings
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=compass&product=was-nd-mp&topic=urun_rconfproc_jvm

Cause

The -Xnoclassgc option prevents class garbage collection in the JVM that results in native memory leak issues.

Resolving The Problem

Remove the -Xnoclassgc option. The performance impact of class garbage collection is typically minimal, but turning off class garbage collection will most likely results in memory leaks and should be avoided. If you specify the -Xnoclassgc option, whenever you redeploy an application, you should always restart the application server to clear the classes and static data from the pervious version of the application.

Related Information

[{"Product":{"code":"SSEQTP","label":"WebSphere Application Server"},"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Component":"Java SDK","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF016","label":"Linux"},{"code":"PF033","label":"Windows"}],"Version":"8.0;7.0;6.1","Edition":"Base;Express;Network Deployment","Line of Business":{"code":"LOB45","label":"Automation"}}]

Document Information

Modified date:
15 June 2018

UID

swg21608274