Skip to content

Instantly share code, notes, and snippets.

@poornan
Created February 17, 2017 07:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save poornan/f9bf7f5cf1e553b8ec5f49a398a5e6dd to your computer and use it in GitHub Desktop.
Save poornan/f9bf7f5cf1e553b8ec5f49a398a5e6dd to your computer and use it in GitHub Desktop.
Create Java thread dump on windows every 20 second
REM The following batch script generates 6 thread dumps at a preset interval of 20 secs
REM script can be executed as
REM threaddump-windows-jstack.bat 2120
REM where 2120 is the java process id
for /L %%i in (1,1,6) do (
echo Taking Thread Dump %i
jstack -l %1 > thread-dump-%%i.txt
timeout 20
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment