Grabbing thread/heap dumps :

Once we get the thread dumps/heap dumps – have you thought of how you will analyze them ? rather than going through each of the text and trying to find out the cause why don’t we use the available tools .
Such tools are Thread analyser and heap anaylser tools – In order to use these tools we would need the dumps to be created in proper format so that it can be read by the tools and help in narrowing down the cause.

Hence I would recommend using the Jstack and Jmap tools for taking the thread and Heap dumps .
these tools come as a part of the JDK just go to the JDK root folder/bin .

i usually use a simple bat file that i created which gives you all the running java process on the machine.

Find all the Java process running either by looking at the task manager or run this command in the CMD 
( as i could not attach the .bat file , what you can do i run the below commands or create a bat file of your own )
 tasklist /FI "IMAGENAME eq java.exe" 
tasklist /FI "IMAGENAME eq javaw.exe" 



Once you know the java PID – Run the below commands to grab the Thread/Heap dumps.
Note: the Exe files come with the JDK ( just go to the Bin and find the jmap/jstack file)
Heap dump command: