A. On a Linux servertop: Find CPU or memory-intensive process PIDtwo. TOP-HP "Process pid"you can continue to track all the thread information in the process, find the CPU or the high-memory thread, convert the thread ID to 16, and use that keyword in subsequent thread stack information to viewthree. Jstack "Process pid" > Jstack_you_file.txtthen less "thread ID" Jstack_you_file.txt can see what threads are performing what tasks use of the jstat of the JDK jstat is a lightweight gadget that comes with the JDK. The full name "Java Virtual machine Statistics monitoring Tool", which is located in the Java Bin directory, mainly uses the JVM built-in instructions for Java application resources and performance of real-time command line monitoring, including the heap Monitoring of size and garbage collection status. As you can see, Jstat is a lightweight, JVM-specific tool that works well for syntax structures:usage:jstat-help|-options Jstat- <option> [-t] [-h<lines>] <vmid> [<interval> [<count>]] parameter explanation: options-option, we generally use- Gcutil View GC Status VMID&NBSP;&NBSP;&NBSP;-VM process number, that is, the current running Java process number interval– interval, in seconds or milliseconds count -printing times, if the default print countless times The percentage of space used in the s0 -heap Survivor space Zone 0 has been s1 -heap on the percentage of space used in Survivor space 1 e -heap The percentage of space used in n space has been used as a percentage of the old space area on o -heap p -perm space has been used as a percentage ygc-from application startup to sampling Youn G GC number of times ygct– the time (in seconds) spent by the young GC from the application boot to sampling fgc-the number of full GC occurrences from the application boot to sample fgct– the time (in seconds) that the full GC takes from the application startup to sampling, gct-from the application Total time (in seconds) for garbage collection when sequencing starts to sampling use 1:[[email protected] bin]# jstat-gcutil 25444 s0 S1 &nBsp e o p YGC ygct fgc fgct gct 11.63 0.00 56.46 66.92 98.49 162 0.248 6 0.331 0.579 Jmap (Memory Map) and Jhat (Java Heap analysis Tool)Jmap-histo [: Live] PID View the number of objects in heap memory, size statistics histogram, with live parameter only to count the surviving object Jmap-dump:format=b,file=dumpyouownfilename.txt PID Dump a memory snapshot to a local file and use Jhat for memory object analysis
Locating Java Virtual machine memory issues Personal Summary