How do I identify what created many threads named "pool-<M>-thread-<N>" that caused "java.lang.OutOfMemoryError: unable to create new native thread" issue in Java application?

Solution Unverified - Updated -

Issue

  • How do I identify what created many threads named pool-<M>-thread-<N> that caused java.lang.OutOfMemoryError: unable to create new native thread issue in Java application?

  • We faces the issue Java java.lang.OutOfMemoryError: unable to create new native thread issue eventually with java application running on JBoss EAP 7 in our environment. When we captured thread dump at the moment, we found many threads named pool-<M>-thread-<N> is running like the following. What causes this? How to identify where these threads were created?

"pool-1-thread-1" #18 prio=5 os_prio=0 tid=0x00007fd6bc1f5000 nid=0x1895 waiting on condition [0x00007fd642ec5000]
   java.lang.Thread.State: WAITING (parking)
    at sun.misc.Unsafe.park(Native Method)
    - parking to wait for  <0x0000000580172bf8> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
    at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
    at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
    at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
    at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1074)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1134)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:750)

"pool-2-thread-1" #28 prio=5 os_prio=0 tid=0x00007fd6bc207800 nid=0x189f waiting on condition [0x00007fd6424bb000]
   java.lang.Thread.State: WAITING (parking)
    at sun.misc.Unsafe.park(Native Method)
    - parking to wait for  <0x00000005802c8d58> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
    at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
    at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
    at java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
    at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1074)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1134)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:750)

Environment

  • Red Hat JBoss Enterprise Application Platform (EAP) 7.x
  • Java

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content