Skip to content

Instantly share code, notes, and snippets.

@kght6123
Last active August 30, 2018 15:53
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 kght6123/ccf92de94a12eece64efea9e5924e99a to your computer and use it in GitHub Desktop.
Save kght6123/ccf92de94a12eece64efea9e5924e99a to your computer and use it in GitHub Desktop.
find java heap dump for windows. https://kght6123.jp/blog/?p=528
@echo off
SET /P "NAME=名前を入力してください>"
SET /P "PID=PIDを入力してください>"
set TIME_TMP=%time: =0%
set NOW=%date:/=%%TIME_TMP:~0,2%%TIME_TMP:~3,2%%TIME_TMP:~6,2%
%JAVA_HOME%\bin\jmap.exe "-dump:format=b,file=%~dp0\heapdump-%PID%-%NAME%-%NOW%.hprof" %PID%
rem -Fを付けると強制
rem %JAVA_HOME%\bin\jmap.exe "-F" "-dump:format=b,file=%~dp0\heapdump-%PID%-%NAME%-%NOW%.hprof" %PID%
@echo on
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment