Created
December 7, 2013 03:19
-
-
Save cowboy-cod3r/7836858 to your computer and use it in GitHub Desktop.
Java: Steps for JVisualVM
This file contains hidden or 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
1. On the tomcat server, do the following: | |
a. Open the firefwall to allow connections over the jmx port | |
b. Make the following directories | |
mkdir -p /home/tomcat/.jvisualvm/7u6 | |
chown -R tomcat:tomcat /home/tomcat | |
c. Add the following java options to tomcat in setenv.sh | |
-Dcom.sun.management.jmxremote | |
-Dcom.sun.management.jmxremote.port=9004 | |
-Dcom.sun.management.jmxremote.ssl=false | |
-Dcom.sun.management.jmxremote.authenticate=false | |
d. Restart tomcat | |
e. In order to get a memory and heap dump properly, you should start JVisualVM as the user that started the JVM process you will attached to. In this case 'tomcat'. | |
xhost + | |
cd /opt/apps/java/java/bin | |
su -c "./jvisualvm" | |
f. You should now be able to capture a heap dump from one of the tabs in the form of an hprof file which can be used with MAT in eclipse. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment