java.lang.OutOfMemoryError: unable to create new native thread | 8 months ago
Click on the to mark the solution that helps you, Samebug will learn from it.
As a community member, you’ll be rewarded for you help.
  1. 0

    ActiveMQ - User - java.lang.OutOfMemoryError: unable to create new native thread | 8 months ago
    java.lang.OutOfMemoryError: unable to create new native thread
  2. 0

    WSO2 CEP - Out of Memory

    Stack Overflow | 4 years ago | Rajiv Patil
    java.lang.OutOfMemoryError: unable to create new native thread
  3. 0

    One of our brokers running 5.10.0 spewed over 1 million of the following exceptions to the log over a 2-hour period: Transport Connection to: tcp:// failed: Unexpected error occurred: java.lang.IllegalStateException: Timer already cancelled. Clients were observed to hang on startup (which we believe means they were unable to connect to the broker) until it was rebooted, after which we haven't seen the exception again. Once the exceptions started, there were no stack traces or other log lines that would indicate anything else about the cause, just those messages repeating. The problems started immediately (a few milliseconds) after an EOFException in the broker logs; we see those EOFExceptions pretty often and they've never before resulted in "Timer already cancelled" exceptions, so that might indicate what got us into a bad state but then again it might be entirely unrelated. I searched JIRA and the mailing list archives for similar issues, and although there are a lot of incidences of "Timer already cancelled" exceptions, none of them exactly match our situation. * describes repeated copies of the line in the logs and is the closest parallel I've found, but it sounded like messages were still getting passed, albeit more slowly than normal, whereas the developer on my team who hit this said he didn't think any messages were getting sent. But it's the closest match of the group. * AMQ-5508 has a detailed investigation into the root cause of the problem that Pero Atanasov saw, but his scenario occurred only on broker shutdown, whereas our broker was not shutting down at the time, and it wasn't clear that the log line repeated for him. * has repeated messages like I'm seeing, but appears to be specific to KahaDB which I'm not using (we use non-persistent messages only). * AMQ-4805 has the same inner exception but not the full log line, and it shows a full stack trace whereas I only see the one line without the stack trace. * appears to see the exception on the producer when sending rather than on the broker. The only thing that we observed that might be related was that earlier in the broker's uptime, the developer who was running it ran up against his maxProc limit and wasn't able to create new native threads. That didn't result in any issues in the broker logs at the time (we only hit these issues several hours later), so I'm skeptical that it's related given that there are lots of other things that cause "Timer already cancelled" exceptions as evidenced by the partial list above, but it could be.

    Apache's JIRA Issue Tracker | 2 years ago | Tim Bain
    java.lang.OutOfMemoryError: unable to create new native thread
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Active MQ giving OutOfMemory error

    Stack Overflow | 5 years ago | anil kumar
    java.lang.OutOfMemoryError: unable to create new native thread
  6. 0

    ElasticSearch: Out of Memory/Unable to create new native thread

    GitHub | 4 years ago | hariharshankar
    java.lang.IllegalArgumentException: Could not instantiate implementation:

  1. QrCeric 3 times, last 1 month ago
  2. filpgame 1 times, last 3 months ago
10 unregistered visitors
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. java.lang.OutOfMemoryError

    unable to create new native thread

    at java.lang.Thread.start0()
  2. Java RT
    1. java.lang.Thread.start0(Native Method)
    2. java.lang.Thread.start(
    3. java.util.concurrent.ThreadPoolExecutor.addIfUnderMaximumPoolSize(
    4. java.util.concurrent.ThreadPoolExecutor.execute(
    4 frames
    1. org.apache.activemq.transport.AbstractInactivityMonitor.writeCheck(
    2. org.apache.activemq.transport.AbstractInactivityMonitor$
    2 frames
  4. ActiveMQ :: Core
    1 frame
  5. Java RT
    1. java.util.TimerThread.mainLoop(
    2 frames