Creating Java Thread Dump and Runtime Snapshot using VisualVM
Java VisualVM is a powerful tool for monitoring, troubleshooting, and profiling Java applications - like jBEAM is.
The thread dump is necessary to analyse permanently blocked processes, such as frozen GUIs. Whereas the runtime snapshot more helps to analyze long-running processes.
It is usually helpful to provide us with both pieces of information.
Installing VisualVM
Previously this tool was part of every Java JDK installation and is now published standalone here: https://visualvm.github.io/
I.e. on Microsoft Windows download it as zip file. Because it does not need to be installed system wide.
Extract it to a location you have write permission to.
Inside find the …/bin/visualvm.exe to start the VisualVM tool.
Start jBEAM and connect to VisualVM
Now start jBEAM but do not start the problematic/ long-running process yet.
Notice the com.AMS.jBEAM_Extern.jBMain (…) node in VisualVM’s left panel.
Performing a Thread Dump
Start the problematic process in jBEAM (and let it run for a few seconds).
In VisualVM find the …jBMain … node.
Press Thread Dump in the context menu.
Select the newly created threaddump node and press Save As… in the context menu.
Send us this .tdump file.
Performing a Runtime Snapshot
Make sure jBEAM is startet.
In VisualVM doubleclick the …jBMain … node.
Now, to find out what and why the jBEAM processes take so long, go to Sampler tab:
Now go back to jBEAM and start the long-running task.
And while it is running, go back to VisualVM in the Sampler tab - click the CPU button:
Now let it run for a few seconds or minutes in this 'stuck' state and then press the Stop button. Followed by pressing the Snapshot button:
Clicking the Snapshot button opens a new “[snapshot] …“ tab: inside it, find the disc icon and press the Export Snapshot Data context menu entry:
Send us the created .nps file.