You may take the dump manually but if you would like to do it automatically then here is how you can do it.The following demonstration is based on The following demonstration is based on WebSphere 9, but the procedure would be similar to other WAS version.

Taking Thread Dump When JVM Stop

There might be a scenario where you would like to take the thread dump whenever JVM stop. This will be useful when you are not sure whom or how JVM is getting stopped. To configure this;

Login to WebSphere Administrative Console Navigate to Servers » Server Types » WebSphere application servers Go inside the JVM and expand “Java and Process Management” under Server Infrastructure Click Process definition Click “Java Virtual Machine” under Additional Properties » Custom properties Click New and enter Name as

Value as true  Click OK

Review and Save the configuration

Now, heap dump will be generated whenever JVM stop. I stopped the JVM and could see the following javacore file on WAS server under profile path.

Taking Thread Dump When Hung

If you are having hung thread issue, and currently you take the dump manually, then you can automate this. By doing basic configuration, WebSphere will generate the dump whenever a thread is hung for configured timed.

Login to WAS Console and go inside respective JVM Expand “Administration” under Server Infrastructure and click Custom Properties Add the following three properties

com.ibm.websphere.threadmonitor.threshold – Generate dump when a thread is hung for configured time. Value is in seconds. com.ibm.websphere.threadmonitor.interval – How frequently thread monitor should check for the hung threads. The value in seconds. com.ibm.websphere.threadmonitor.dump.java – Generate dump when detected. Value is true.

Above configuration will generate dump whenever a thread is hung for 600 seconds, and WebSphere will monitor the thread every 300 seconds. Once you have the dump, you can analyze and fix the application issue. I hope this helps.

How to take Thread Dump Automatically when WebSphere Hung Stop  - 51How to take Thread Dump Automatically when WebSphere Hung Stop  - 3How to take Thread Dump Automatically when WebSphere Hung Stop  - 48How to take Thread Dump Automatically when WebSphere Hung Stop  - 44How to take Thread Dump Automatically when WebSphere Hung Stop  - 77How to take Thread Dump Automatically when WebSphere Hung Stop  - 2How to take Thread Dump Automatically when WebSphere Hung Stop  - 11How to take Thread Dump Automatically when WebSphere Hung Stop  - 82How to take Thread Dump Automatically when WebSphere Hung Stop  - 72How to take Thread Dump Automatically when WebSphere Hung Stop  - 90How to take Thread Dump Automatically when WebSphere Hung Stop  - 63How to take Thread Dump Automatically when WebSphere Hung Stop  - 50How to take Thread Dump Automatically when WebSphere Hung Stop  - 15How to take Thread Dump Automatically when WebSphere Hung Stop  - 66How to take Thread Dump Automatically when WebSphere Hung Stop  - 80How to take Thread Dump Automatically when WebSphere Hung Stop  - 73How to take Thread Dump Automatically when WebSphere Hung Stop  - 30How to take Thread Dump Automatically when WebSphere Hung Stop  - 72How to take Thread Dump Automatically when WebSphere Hung Stop  - 45How to take Thread Dump Automatically when WebSphere Hung Stop  - 50How to take Thread Dump Automatically when WebSphere Hung Stop  - 89How to take Thread Dump Automatically when WebSphere Hung Stop  - 12How to take Thread Dump Automatically when WebSphere Hung Stop  - 5How to take Thread Dump Automatically when WebSphere Hung Stop  - 33How to take Thread Dump Automatically when WebSphere Hung Stop  - 71