Java java.lang.OutOfMemoryError "unable to create new native thread" or "Failed to create a thread"

Solution Verified - Updated -

Issue

  • Encountered the following exception in the JBoss server log using OpenJDK or Oracle JDK:

        java.lang.OutOfMemoryError: unable to create new native thread
          at java.lang.Thread.start0(Native Method)
          at java.lang.Thread.start(Thread.java:597)
          ...
    
  • The IBM javacore file shows the following:

        1TISIGINFO     Dump Event "systhrow" (00040000) Detail "java/lang/OutOfMemoryError" "Failed to create a thread: retVal -1073741830, errno 11" received
    
  • The Oracle crash file reports the following:

    # There is insufficient memory for the Java Runtime Environment to continue.
    # Cannot create GC thread. Out of system resources.
    [...]
    
  • ActiveMQ on broker throw java OOM error

  • The following in the OpenJDK or Oracle/Sun JDK fatal error log:

    #  Out of Memory Error (gcTaskThread.cpp:46), pid=5490, tid=139954866263808
    

Environment

  • OpenJDK
  • Oracle JDK
  • IBM JDK

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In