title: Exception: OutOfMemoryError due to multiple calls of sun.misc.Unsafe.park
body: <p>My Java program crashes on mac due to OutOfMemoryError. When I tried to print all active threads, I found the below stacktrace. There were many instances of these threads which related to "sun.misc.Unsafe.park". One of the possible reasons can be presence of deadlock. Is there a way to find out which part of my program is responsible for this?</p>
  
  <pre><code>Thread Class: class java.lang.Thread|||
  Thread id: 90|||||||
  StackTrace:  sun.misc.Unsafe.park(Native Method)
  java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
  java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
  java.util.concurrent.LinkedBlockingQueue.take(LinkedBlockingQueue.java:442)
  java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1067)
  java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1127)
  java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
  java.lang.Thread.run(Thread.java:745) 
  </code></pre>