1

I've been given a thread dump generated by jvisualvm for a native shared library which is implemented using JNI. It's running in an app that is calling into it from multiple threads via Dot.Net's Parallel.For . The java portion of the library has a thread pool, but its size is limited, and the native portion of the library does not create any threads itself.

What seems to be happening is that more and more threads are being created, and eventually the app crashes with an out of memory error. The strange thing is that basically the only thing the app is doing is calling into the library within the Parallel.For in a loop, and any threads created by it shouldn't 'leak' (right?).

The thread dump contains many entries of the form:

"Thread-139" prio=6 tid=0x0ba33c00 nid=0x22ac runnable [0x00000000]
   java.lang.Thread.State: RUNNABLE

   Locked ownable synchronizers:
    - None

What exactly does that mean?

Bwmat
  • 4,314
  • 3
  • 27
  • 42
  • That looks like an idle thread within a thread-pool. Does the threadpool have a timeout and/or a reasonable thread count set? – Aurand May 17 '13 at 04:02
  • @Aurand -Although I can't confirm this right now, I've been told that the thread pool is limited to 10 threads, dunno about timeout. Also, the Parallel.For is using 16 threads (supposedly). Also, wouldn't an idle threadpool worker thread be blocked on some work queue, and that would show up in a call stack for it? – Bwmat May 17 '13 at 04:16

0 Answers0