@echo on
SET JAVA_HOME=C:\abs\visualvm\jdk1.6.0_23
SET PATH=%JAVA_HOME%\bin;%VISUALVM_HOME%\bin;%PATH%

echo Check the process_id, this is the number before Main
echo.
jps
echo.
echo.
SET /P PROCESS_ID=provide the process_id and press enter: 
echo %PROCESS_ID%
echo.
jmap -dump:format=b,file=c:\abs\memorydump.hprof %PROCESS_ID%
echo.
jmap -histo %PROCESS_ID% > c:\abs\memoryhisto.txt

pause

