8 Replies Latest reply on Nov 10, 2008 7:18 PM by jschellSomeoneStoleMyAlias

    java.lang.OutOfMemoryError: unable to create new native thread

      I have a Java process which have run for some time, and then started to get the following error:
      java.lang.OutOfMemoryError: unable to create new native thread
      at java.lang.Thread.start0(Native Method)
      at java.lang.Thread.start(Unknown Source)
      at java.util.concurrent.ThreadPoolExecutor.addIfUnderMaximumPoolSize(Unknown Source)
      at java.util.concurrent.ThreadPoolExecutor.execute(Unknown Source)

      When I look at the process list using "top" (Unix machine) I see that for this process the size of the "VIRT" column is 2500m. Since I am quite un-experienced both with Linux and with Java memory profiling, I would like an advise.

      What does it mean that the "VIRT" column is 2500m? Does it imply a memory leak, or could some other factors affect this value?
      Does the exception imply that the thread pool is too big? How can I introspect it to understand its state? I am using Executors.newCachedThreadPool() as my thread pool, which should not raise any size issues. I am using Java 5.
      Should I put a memory profiler to analyze the memory usage of this process?

      Please advise,