title: Thousands of threads spawned from Java process... why?
body: <p>I have a problem with a recent customer migration to Linux (64-bit) when running a Java process.</p>
  
  <p>The process is spawning thousands of threads most with an identifier of futex. I've looked up futex (fast userspace mutex) and it's a Linux construct to implement basic locking.</p>
  
  <p>The code has recently changed to implement a BlockingQueue and an ExecutorService to spawn child threads but the number of child threads is controlled by a config setting and I can prove that this specific mechanism is not running out of control. I can only assume that something internal to the JVM is spawning all these threads due to the BlockingQueue and some lock?</p>
  
  <p>So can anyone tell me how to find out what these threads actually are and what I might do to control/stop them?</p>
  
  <p>Below is a few lines of the process list; the actual list before the process had to be killed was over 13000 lines long.</p>
  
  <p>0 - 54321   447   446  1   -   - - 5953085 -    ?        00:15:50 java<br>
  0 S 54321     -     -  0  82   2 -     - futex_ -        00:00:00 -<br>
  1 S 54321     -     -  0  82   2 -     - futex_ -        00:00:00 -<br>
  1 S 54321     -     -  0  82   2 -     - futex_ -        00:00:00 -<br>
  1 S 54321     -     -  0  82   2 -     - futex_ -        00:00:00 -<br>
  1 S 54321     -     -  0  82   2 -     - futex_ -        00:00:00 -<br>
  1 S 54321     -     -  0  82   2 -     - futex_ -        00:00:00 -<br>
  1 S 54321     -     -  0  82   2 -     - futex_ -        00:00:00 -<br>
  1 S 54321     -     -  0  82   2 -     - futex_ -        00:00:00 -  </p>
  
  <p>Any suggestions gratefully accepted.</p>