Automate Thread Dump logging and collection on server


  1. Download JDK as follows and Get Heap Memory dump and Thread dump:
  2. Setup Auto-capturing of Thread Dump logging
    • mkdir {QMetry Installed Folder Name}/qmetry-logs/capturedlogs
      • Put attached file in below mentioned folder : {QMetry Installed Folder Name}/qmetry-dump.sh
    • Now create crontab using below command
      • crontab -e
    • After this command execution editor will open and write below details in that. After add below line save and exit editor using :wq 
      • 0 */4 * * *  sh /home/qmetry/{QMetry Installed Folder Name}/qmetry-dump.sh  /home/qmetry/{QMetry Installed Folder Name}/qmetry-logs/capturedlogs {JAVA PID}
    • Below command list crontab
      • crontab -l

Note :

  • if crontab command is not working then use “yum install cronie” command to install it
  • jdk1.8.0_211 must be present at /opt location.