Last active
November 4, 2021 10:15
-
-
Save azinneera/419d9f6507aeed17a9a4de92cc999ca9 to your computer and use it in GitHub Desktop.
Windows .bat file to generate thread dumps for java process
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
REM This batch script generates a given number of thread dumps at a given interval in seconds | |
REM To generate 4 thread dumps at 15s intervals for the java process with id 1234 | |
REM execute the script as | |
REM threaddump-jstack.bat 1234 4 15 | |
for /L %%i in (1,1,%2) do ( | |
echo Taking Thread Dump %%i | |
jstack -l %1 > thread-dump-%%i.txt | |
timeout %3 | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment