Skip to content

Instantly share code, notes, and snippets.

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 abhilater/cbc4f9c404bd14cb2ef5c5e198bfae02 to your computer and use it in GitHub Desktop.
Save abhilater/cbc4f9c404bd14cb2ef5c5e198bfae02 to your computer and use it in GitHub Desktop.
running jmxterm from command line to force gc
wget http://downloads.sourceforge.net/project/cyclops-group/jmxterm/0.2/jmxterm-0.2-uber.jar
a@a:~$ java -jar jmxterm-0.2-uber.jar
Welcome to JMX terminal. Type "help" for available commands.
?$ open localhost:8076
Connection to localhost:8076 is opened
>$ bean java.lang:type=Memory
bean is set to java.lang:type=Memory
>$ run gc
calling operation gc of mbean java.lang:type=Memory
operation returns:
null
jmap -dump:format=b,file=memory.hprof PIDHERE
sometimes
sudo jmap -dump:format=b,file=memory.hprof PIDHERE
sometimes
sudo -u useridofprocess jmap -dump:format=b,file=memory.hprof PIDHERE
sometimes requires
echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope
make sure CWD or process is writeable by owner of process
jstat -gcnew -h 10 PIDHERE 2000
jstat -gcold -h 10 PIDHERE 2000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment