Geekflare is supported by our audience. We may earn affiliate commissions from buying links on this site.
In WebSphere Last updated: September 6, 2022
Share on:
Invicti Web Application Security Scanner – the only solution that delivers automatic verification of vulnerabilities with Proof-Based Scanning™.

Thread dump is essential for Java application troubleshooting. If you are working on performance related, memory leakage, debugging, etc. then you will often be asked to take thread and heap dump.

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.

-rw-r--r--. 1 root root 3179348 Nov 28 22:49 javacore.20161128.224916.4926.0001.txt
-rw-r--r--. 1 root root 3124208 Nov 28 22:49 javacore.20161128.224924.4926.0002.txt

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 – Generate dump when a thread is hung for configured time. Value is in seconds. – How frequently thread monitor should check for the hung threads. The value in seconds. – 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.

  • Chandan Kumar
    As the founder of Geekflare, I’ve helped millions to excel in the digital realm. Passionate about technology, I’m on a mission to explore the world and amplify growth for professionals and businesses alike.
Thanks to our Sponsors
More great readings on WebSphere
Power Your Business
Some of the tools and services to help your business grow.
  • Invicti uses the Proof-Based Scanning™ to automatically verify the identified vulnerabilities and generate actionable results within just hours.
    Try Invicti
  • Web scraping, residential proxy, proxy manager, web unlocker, search engine crawler, and all you need to collect web data.
    Try Brightdata
  • is an all-in-one work OS to help you manage projects, tasks, work, sales, CRM, operations, workflows, and more.
    Try Monday
  • Intruder is an online vulnerability scanner that finds cyber security weaknesses in your infrastructure, to avoid costly data breaches.
    Try Intruder