Get thread dump and heap dump for MID ServerIssue <!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } span { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } h2 { font-size: 24pt; font-family: Lato; color: var(--now-color--text-primary, black); } h3 { font-size: 18pt; font-family: Lato; color: var(--now-color--text-primary, black); } h4 { font-size: 14pt; font-family: Lato; color: var(--now-color--text-primary, black); } a { font-size: 12pt; font-family: Lato; color: var(--now-color--link-primary, #00718F); } a:hover { font-size: 12pt; color: var(--now-color--link-primary, #024F69); } a:target { font-size: 12pt; color: var(--now-color--link-primary, #032D42); } a:visited { font-size: 12pt; color: var(--now-color--link-primary, #00718f); } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: ; max-width: ; width: ; height: ; } } On rare occasions when a MID Server cannot or is slow to pick up messages from the instance, you would like to get a thread dump to troubleshoot. This article describes how to do so. Note that you need to have login access to the MID Server. Release<!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } span { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } h2 { font-size: 24pt; font-family: Lato; color: var(--now-color--text-primary, black); } h3 { font-size: 18pt; font-family: Lato; color: var(--now-color--text-primary, black); } h4 { font-size: 14pt; font-family: Lato; color: var(--now-color--text-primary, black); } a { font-size: 12pt; font-family: Lato; color: var(--now-color--link-primary, #00718F); } a:hover { font-size: 12pt; color: var(--now-color--link-primary, #024F69); } a:target { font-size: 12pt; color: var(--now-color--link-primary, #032D42); } a:visited { font-size: 12pt; color: var(--now-color--link-primary, #00718f); } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: ; max-width: ; width: ; height: ; } } All currently supported releases. Resolution<!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } span { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } h2 { font-size: 24pt; font-family: Lato; color: var(--now-color--text-primary, black); } h3 { font-size: 18pt; font-family: Lato; color: var(--now-color--text-primary, black); } h4 { font-size: 14pt; font-family: Lato; color: var(--now-color--text-primary, black); } a { font-size: 12pt; font-family: Lato; color: var(--now-color--link-primary, #00718F); } a:hover { font-size: 12pt; color: var(--now-color--link-primary, #024F69); } a:target { font-size: 12pt; color: var(--now-color--link-primary, #032D42); } a:visited { font-size: 12pt; color: var(--now-color--link-primary, #00718f); } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: ; max-width: ; width: ; height: ; } } How to get thread dump and heap dump ServiceNow's OpenJDK bundled with MID Servers include jstack and jmap in the agent\jre\bin folder.(If gathering thread dump) Download and unzip PSTools: https://technet.microsoft.com/en-us/sysinternals/bb897553.aspx. You might not have to do this but PsExec is needed to invoke jstack.exe on a process that is run as Local System, this used to be the default but now MID Servers are often running as a non-admin service account when the MID Server is run as a Windows service.Open Task Manager. In 'Processes' tab, sort by Image Name then find 'java.exe' processes. Note the process ID under 'PID' column. If 'PID' column is not shown, goto View > Select Column... and select 'PID' column. if multiple MID Servers are running, right click each 'java.exe' process then select Properties, to verify correct MID Server process. (If gathering thread dump) Open Command Prompt as Administrator change to directory where PSTools is unzipped in step 2. Run the following command if MID Server service account is 'SYSTEM': psexec -s "<path_to_jdk_install>\bin\jstack" -l PID_HERE >> <path_for_generated_file>\threadDump.txt if MID Server service account is a user: psexec -u <username> "<path_to_jdk_install>\bin\jstack" -l PID_HERE >> <path_for_generated_file>\threadDump.txt (If gathering heap dump) Run this command: <path_to_jdk_install>\bin\jmap -dump:file=<path_for_generated_file>\heapDump.bin PID_HERE Alternately, to dump the heap automatically on out-of-memory exception, modify the wrapper-override.conf file found in the /agent/conf/ directory by adding the following: "wrapper.app.additional.501=-XX:+HeapDumpOnOutOfMemoryError" OR "wrapper.java.additional.501=-XX:+HeapDumpOnOutOfMemoryError". ***WARNING: This parameter should only be used for short term with active monitoring. As soon as OOM is reproduced and Heapdump is generated, the parameter must be removed. Leaving this parameter in place for extended period can potentially exhaust disk space. There should be no duplicates in either /agent/conf/wrapper.conf or /agent/conf/wrapper-override.conf files. Here is an example: References jmap - Memory Map – How to use jmap jstack - Stack Trace – How to use jstack Related Links<!-- /*NS Branding Styles*/ --> .ns-kb-css-body-editor-container { p { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } span { font-size: 12pt; font-family: Lato; color: var(--now-color--text-primary, #000000); } h2 { font-size: 24pt; font-family: Lato; color: var(--now-color--text-primary, black); } h3 { font-size: 18pt; font-family: Lato; color: var(--now-color--text-primary, black); } h4 { font-size: 14pt; font-family: Lato; color: var(--now-color--text-primary, black); } a { font-size: 12pt; font-family: Lato; color: var(--now-color--link-primary, #00718F); } a:hover { font-size: 12pt; color: var(--now-color--link-primary, #024F69); } a:target { font-size: 12pt; color: var(--now-color--link-primary, #032D42); } a:visited { font-size: 12pt; color: var(--now-color--link-primary, #00718f); } ul { font-size: 12pt; font-family: Lato; } li { font-size: 12pt; font-family: Lato; } img { display: ; max-width: ; width: ; height: ; } } KB0717248 How to automatically generate the heap dump from Mid when JVM runs out of memory KB0746066 How to analyse a MID Server Heap Dump, for High Memory usage