Oracle Glassfish Server Crashes With "java.lang.OutOfMemoryError: unable to create new native thread" (Doc ID 1502850.1)

Last updated on JULY 12, 2017

Applies to:

Oracle GlassFish Server - Version 2.1 and later
Information in this document applies to any platform.


Oracle GlassFish Server crashes with "java.lang.OutOfMemoryError: unable to create new native thread" in the server.log

[#2012-10-2316:22:14.904-0400|SEVERE|oracle-glassfish3.1.1||_ThreadID=314;_ThreadName=Thread-2;|java.lang.OutOfMemoryError: unable to create new native thread
at java.lang.Thread.start0(Native Method)
at java.lang.Thread.start(
at java.lang.UNIXProcess$
at Method)
at java.lang.UNIXProcess.(
at java.lang.ProcessImpl.start(
at java.lang.ProcessBuilder.start(
at java.lang.Runtime.exec(
at java.lang.Runtime.exec(
at CGIServlet_5_5_9.CGIServlet$
at CGIServlet_5_5_9.CGIServlet.doGet(
at CGIServlet_5_5_9.CGIServlet.doPost(
at javax.servlet.http.HttpServlet.service(
at javax.servlet.http.HttpServlet.service(
at org.apache.catalina.core.StandardWrapper.service(
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
at org.apache.catalina.core.ApplicationFilterChain.doFilter(
at org.fstrf.common.web.UserGateway.CgiFilter.doFilter(Unknown Source)


The crash also generates an hs_err log in the config directory. The hs_err log shows the following information:

# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (malloc) failed to allocate 32756 bytes for ChunkPool::allocate
# Possible reasons:
# The system is out of physical RAM or swap space
# In 32 bit mode, the process size limit was hit
# Possible solutions:
# Reduce memory load on the system
# Increase physical memory or swap space
# Check if swap backing store is full
# Use 64 bit Java on a 64 bit OS
# Decrease Java heap size (-Xmx/-Xms)
# Decrease number of Java threads
# Decrease Java thread stack sizes (-Xss)
# Set larger code cache with -XX:ReservedCodeCacheSize=
# This output file may be truncated or incomplete.
# Out of Memory Error (allocation.cpp:211), pid=12378, tid=19
# JRE version: 6.0_27-b07
# Java VM: Java HotSpot(TM) Server VM (20.2-b06 mixed mode solaris-sparc )





Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms