jvm--performance monitoring and fault handling tools
Hotspot virtual machines provide a number of virtual machine runtime debugging tools that allow developers to monitor and optimize the performance of virtual machines and applications while the app is running.
JPS:JVM Process Status Tool
Displays all the hotspot virtual machine processes within the specified system. and displays the name of the virtual machine execution main class (the class where main class, Main () function resides), and the unique ID of the local virtual machine for those processes (Lvmid, local Vsan Identifier).
JPS command format: JPS [Options] [HostID]
Main parameter options:
- Q : Output only Lvmid, omit the name of the main class
- M : Outputs the parameters passed to the main class main () function when the virtual machine process starts
- L : Outputs the whole of the main class, if the selection executes a jar package, the output jar start diameter
- v : Output virtual machine process startup JVM parameters
JSTAT:JVM Statistics Monitoring Tool
Used to collect operational data for all aspects of the hotspot virtual machine. You can display class load, memory, garbage collection, JIT compilation, and other running data in a local or remote virtual machine process.
Jstat command format: jstat [option Vmid [internal [s | ms] [COUNT]]
Main parameter options
-class : Monitor class load, unload quantity, total space, and class load time spent
-GC : Monitor Java heap status, Eden Zone, 2 survivor Zone, old age, permanent generation, etc., the maximum, used space, GC time totals, and other information
-gccapacity : The monitoring content is basically the same as-GC, but the output focuses on the maximum and minimum space used by each area of the Java heap
-gcutil : The monitoring content is the same as the-GC, but the output focuses on the percentage of space used to occupy the total space
-gccause : Same as-gcutil function. But the extra output causes the last GC to produce
-gcnew : Monitor the status of the new generation GC
-gcnewcapacity : The monitoring content is basically the same as-gcnew, and the output focuses on the maximum and minimum space used
-gcold : The status of GC in the old age
-gcoldcapacity : The monitoring content is basically the same as-gcold, and the output focuses on the maximum and minimum space used
-gcpermcapacity : Outputs the maximum and minimum space used by the permanent generation
-compiler : Output JIT compiler compiled methods, Anisakis, and other information
-printcompilation : Outputs a party station that has been JIT-compiled
jinfo:configuration Info for Java
Displays the virtual machine configuration information. View and adjust the parameters of a virtual machine in real time. Different operating system support programs are not the same.
Jinfo command format: jinfo [option] pid
jmap:memory Map for Java
Generate a memory dump snapshot (heapdump file) of the virtual machine. It can also query the details of the Finalize execution queue, the Java heap, and the permanent generation, such as space usage, which collector is currently in use, and so on.
JMAP command format: jmap [option] Vmid
-dump : Generates a Java heap dump snapshot. Format:-dump: [live,]format=b,file=<filename>, where the live sub-argument indicates whether to dump only the surviving objects
-finalizerinfo : Displays an object in F-queue that waits for the finalizer thread to execute a finalize method. Valid only on Linux/solaris platform
-heap : Displays the Java heap details, such as which collector to use, parameter configuration, generational status, and so on. Valid only on Linux/solaris platform
-histo : Displays the object statistics in the heap, including the class, number of instances, and total capacity
-permstat : Displays the permanent memory status with ClassLoader as the statistical aperture. Valid only on Linux/solaris platform
- F : Use this option to force a dump snapshot when the virtual machine process does not respond to the-dump option. Only valid under Linux/solaris platform
JHAT:JVM Heap Dump Browser
For parsing the Heapdump file, it establishes a http/html server that allows the user to view the results of the analysis on the browser. Often used in conjunction with JMAP.
jstack:stack Trace for Java
Displays a thread snapshot of the virtual machine. A thread snapshot is a collection of method stacks that each thread in the current virtual machine is executing, and the primary purpose of generating a thread snapshot is to locate the cause of a thread's long pause, such as a deadlock between threads, a dead loop, a long time to request external resources, and so on. When a thread pauses, you can see the call stacks of each Chan Cheng by Jstack, and you know what the unresponsive thread is doing in the background, or what resources are waiting for it.
"008" "jvm--performance monitoring and fault handling tool"