How Can We Take Thread Dump in Java ?

The steps to take Thread dump of Java process depends on the operating system.

On taking Thread dump, Java writes the state of all threads in log files or standard error console.

We can press Ctrl + Break key together to take thread dump in Windows.

We can execute kill -3 command for taking Thread dump on Linux. Another option to take Thread dump is jstack tool. We can pass process id of java process to this tool for taking Thread dump.

This is the simple one, -Xss parameter is used to control stack size of Thread in Java. You can see this list of JVM options to learn more about this parameter.



You May Interest

How Can We Analyze the Dependencies in Java Classes and Packages ...

Why Integer Class in Final in Java ?

How Will You Sort Objects by Natural Order in a Java List ?

How Stack and Heap Work in Java Multi-threading Environment ?

Replacing Hashtable With ConcurrentHashMap in Java