I have to fix an application which heavily relies on JMS.
It crashes after it has received a number of messages, because of a
java.lang.OutOfMemoryError: unable to create new native thread A thread dump and jconsole show that
If have already tried to identify all the points where JMS messages are send in the application and made sure that close() is called on sender, session and connection.
However the threads still accumulate.
What would be the best way to further analyse this? Is there a possibility to exactly find out which of my classes starts those threads which do not terminate?