Products | Versions |
---|---|
TIBCO ActiveMatrix Service Grid | - |
Not Applicable | - |
Resolution:
Check the below links for details, downloading and installing jvmstat, which contains visualgc tool.
http://java.sun.com/performance/jvmstat/
http://java.sun.com/performance/jvmstat/visualgc.html
Once jvmstat tool is installed, there are three cases to consider
1. JVM is running from command prompt and visualgc tool is also running on the same machine.
In this case simply run visualgc tool with process id of node or what ever the JVM that need to monitored as command line parameter. It will connect to the jvm and start displaying gc details graphically.
2. JVM is running as windows service and visualgc tool is running from command prompt.
In this case makes sure that visualgc and JVM running as windows service both are running using the same windows userid. If JVM is running with "system" account, visualgc may not be able to access the JVM process using PID and hence it cannot connect to it.
3. JVM needs to be monitored and visualgc tool are running on two different boxes.
In this case please follow the below steps
a). On the machine on which JVM is running, jstatd tool needs to be run. The tool jstatd is packaged along with JDK
b). jstatd tool needs a security policy. Create a file named "jstatd.all.policy" and paste the below content in it. Place the file in the same folder in which jstatd tool is present.
grant codebase "file:${java.home}/../lib/tools.jar" {
permission java.security.AllPermission;
};
c). Start the jstatd as shown below
jstatd -J-Djava.security.policy=jstatd.all.policy
d). Now the visualgc tool on the different machine has to be started as shown below
>visualgc <PID>@<hostname>
PID above is process id of JVM running on remote box
hostname is the remote box name on which JVM is running
Here visualgc tool connects to the JVM thru jstatd running on the remote box thru default RMIRegistry port 1099, hence you do not have to specify RMIRegistry explictly. If jstatd is running using different port you need to specifiy it as shown below
>visualgc <PID>@<hostname>:<jstatd port>