Java virtual machine (JVM) crash on Solaris throws java.lang.OutOfMemoryError exception
 Technote (troubleshooting)
 
Problem(Abstract)
The Application Server crashes with a SIGSEGV and the pstack output is corrupted. The pmap shows that the [heap] has exceeded 2GB.

The hs_err_pid*.log file shows the following:

An unexpected exception has been detected in native code outside the VM.
Unexpected Signal : 11 occurred at PC=0xff330924
Function name=memcpy
Library=/usr/platform/SUNW,Ultra-80/lib/libc_psr.so.1
 
Cause
This is a bug in the HotSpot server mode and there is a Sun defect opened, reference Sun Bug Id 4724509:

There can be other reasons that the core is so large, like a native memory leak, possibly with the DB drivers.

The Sun JDK™ 1.3.1 doesn't always produce a Java™ thread dump when a crash occurs, especially when the crash is inside the HotSpot library.

Below, the pmap command output shows that the native heap has grown to over 2 GB. Such
a large heap size is unusual for a Java application and can lead to memory problems, as in a crash in the C runtime library (libc) function memory:

core 'core1' of 16996: /opt/WebSphere/AppServer/java/jre/bin/../bin/sparc/native_threads/java
00010000 24K read/exec /opt/WebSphere/AppServer/java/jre/bin/sparc/native_threads/java
00024000 8K read/write/exec /opt/WebSphere/AppServer/java/jre/bin/sparc/native_threads/java
00026000 2088888K read/write/exec [ heap ]

A known bug in Java HotSpot Server mode might cause this large heap. In rare circumstances, the compiler gets into an expansion loop and asks for larger and larger amounts of heap memory on malloc (memory allocation) calls within the loop that is expanding the heap size. When this happens, a java.lang.OutOfMemoryError with a large "CompileThread0" request is logged in an hs_err_pid log and a pmap of the core file generated shows a heap size that is unusually large, frequently 2000 MB or more.
 
Resolving the problem
There are several possible ways to resolve this problem.
  1. Switch to the Java HotSpot Client VM. Refer to the technote, Setting up a HotSpot server or client mode on a Java 2 SDK

    Note: Application Servers in V4.0 releases run in HotSpot server mode by default. Application Servers in V5.0 releases run in Hotspot client mode by default.

  2. If it is not an option to switch to the client HotSpot compiler, identify the methods causing the crash and skip from HotSpot comp.

    Refer to technote Debugging HotSpot failures on Solaris®

  3. Upgrade to JDK 1.3.1_08 or later. The fix for SunBug 4724509 is in JDK 1.3.1_08. http://developer.java.sun.com/developer/bugParade/bugs/4724509.html

    Note: Sometimes this upgrade does not resolve this problem.

If a java.lang.OutOfMemoryError is issued and this upgrade does not solve the problem, refer to this technote: JAVA.LANG.OUTOFMEMORYERRORs (Solaris).
 
 
Cross Reference information
Segment Product Component Platform Version Edition
Application Servers Runtimes for Java Technology Java SDK
 
 


Document Information


Product categories: Software > Application Servers > Distributed Application & Web Servers > WebSphere Application Server > Java SDK
Operating system(s): Solaris
Software version: 5.1
Software edition:
Reference #: 1159828
IBM Group: Software Group
Modified date: Sep 9, 2004