title: Analyzing stuck threads on a native method
body: <p>I'm using tomcat and java 1.7.0_80. The product is rule engine using drools.
  I'm having a slowdown after loading the system. I took a thread dump and see many threads that look like:</p>
  
  <pre><code>http-bio-9980-exec-48" daemon prio=10 tid=0x00007fa8b43a3000 nid=0x10299             runnable [0x00007fa9522c5000]
  java.lang.Thread.State: RUNNABLE
      at java.lang.Class.getDeclaredConstructors0(Native Method)
      at java.lang.Class.privateGetDeclaredConstructors(Class.java:2595)
      at java.lang.Class.getConstructor0(Class.java:2895)
      at java.lang.Class.newInstance(Class.java:354)
      at sun.reflect.MethodAccessorGenerator$1.run(MethodAccessorGenerator.java:399)
      at sun.reflect.MethodAccessorGenerator$1.run(MethodAccessorGenerator.java:396)
      at java.security.AccessController.doPrivileged(Native Method)
      at sun.reflect.MethodAccessorGenerator.generate(MethodAccessorGenerator.java:395)
      at sun.reflect.MethodAccessorGenerator.generateMethod(MethodAccessorGenerator.java:77)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:46)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:606)
  .
  .
  .
  </code></pre>
  
  <p>I think these threads are stuck, so I did another thread dump (to see what happens on the native method):</p>
  
  <pre><code>00007faa1dabf6d5      __pthread_cond_wait + 0xc5
  0x00007faa1cb638ad      _ZN15JvmtiRawMonitor9raw_enterEP6Thread + 0x25d
  0x00007faa1cb3f63d      _ZN8JvmtiEnv15RawMonitorEnterEP15JvmtiRawMonitor + 0xad
  0x00007faa1b7089a8      debugMonitorEnter + 0x38
  0x00007faa1b6f5205      event_callback + 0xe5
  0x00007faa1b6f5e3e      cbClassPrepare + 0x8e
  0x00007faa1cb548c4      _ZN11JvmtiExport18post_class_prepareEP10JavaThreadP12klassOopDesc + 0x1b4
  0x00007faa1ca1de8e      _ZN13instanceKlass15link_class_implE19instanceKlassHandlebP6Thread + 0x45e
  0x00007faa1cae55c7      JVM_GetClassDeclaredConstructors + 0x1b7
  0x00007faa180cac39      * java.lang.Class.getDeclaredConstructors0(boolean) bci:0 (Interpreted frame)
  </code></pre>
  
  <p>Can someone tell me why do I have contention in here?</p>