For collecting Thread dump:
If the application is running in command mode , then at the time the issue occurrence you can collect thread dump by pressing CTRL+Fn+B ( For Windows) and CTRL+\ ( for Linux) . This will generate thread dump in the command prompt. Copy the complete text and paste it in Notepad/Wordpad as Threaddump1.txt. Sameway proceed to take two more dumps by using the same commands.
For collecting Heap Dump:
It is necessary to install JDK and JMAP. Once you install this in Windows machine you can generate the heap dump using the command ,
psexec -s jmap -dump:format=b,file=cheap.bin <PID>
PID - It is the process ID
Direct Links to download,
After downloading JMAP, extract and move to Java folder under program files where JDK usually installs by default.
So after executing the command, you get confirmation as below.
cheap.bin will be stored under mostly in C:\Windows\System32\cheap.bin
Other ways to collect heapdump,
Apart from the above details collect the Logs folder present in the ServiceDeskPlus-MSP folder for analysis which has Currentqueriesinformation.html,connectiondump files.
For Linux :
jmap -dump:file=heapdump.bin pid
Herewith i have attached 2 Gif on how to generate Thread dump and heap dump in Linux.