jvm performance analysis
pid lists all the native java process: First, JPS
Command Options
- -q output VM identifier only, not including the class name, jar name, arguments in main method
- -m output main method parameters
- -l output of the full package name, application name of the main class, jar full pathname
- -v output parameters jvm
- -V output to a JVM parameters (.hotspotrc document or file by the flag of -XX: Flags = the specified file
- -Joption pass parameters to vm, for example: -J-Xms48m
Two, jmap: Performance Tuning Tools
jmap -help to view command instructions
As shown, the command format: jmap [option] <pid>
parameter:
- option: Option parameter.
- pid: the need to print a configuration process ID information.
- executable: generating a core dump of the Java executable.
- core: the need to print the core configuration file information.
- server-id optional unique id, if multiple debug servers running on the same remote host, this option parameter identifies the server.
- Server hostname or IP Remote IP address or host name of the remote debugging server.
option parameters:
- no option: the memory image to view process information, similar to the Solaris pmap command.
- heap: show Java heap Details
- histo [: live]: Displays statistics object on the heap
- clstats: print class loader information
- finalizerinfo: displaying an object queue for execution of the method finalizer thread F-Queue Finalizer
- dump: <dump-options>: green heap dump snapshots
- F: When -dump no response, or the -dump parameters -histo In this mode, the sub-Live parameter is invalid.
- help: print help
- J <flag>: Specifies the JVM to the runtime parameters jmap
Parameters are as follows:
- -l long listings, will print out additional lock information, you can use jstack -l pid locks held to observe the situation when a deadlock occurs
- -m mixed mode, not only will output Java stack information will be printed in C / C ++ stack information (such as Native Method)
Four, jstat: JVM statistics monitoring tool
1000ms recorded every time printing, the print 10 is stopped, the print head after each 3 row index
jstat -gc -h3 10 1000 10
Five, hprof: show CPU usage, memory usage statistics heap