To view the usage of heap memory under this process
Jmap-heap 1963 (Process number)
Quick way to locate memory leaks:
Jmap-histo:live 1963
Jmap-histo:live 1963 >1.txt Output information to a specified file
You can find the specific method that caused the memory overflow.
3. You can also use Jhat to analyze the cause of memory overflow
Use dump memory information to Heap.bin file
Jmap-dump:live,format=b,file=heap.bin 1963 (Process number)
Using Jhat to analyze Heap.bin files
jhat-j-mx512m Heap.bin If there is not enough memory in the parsing process, you need to increase the memory such as: jhat-j-mx800m Heap.bin
You can see the results of the analysis by accessing Http://192.168.5.105:7000/through the browser
4.jstat Monitoring garbage collection (GC) time, number of times
S0: Survival Zone 0
S1: Survival Zone 1
E: Young Generation
O: Old generation
M: Lasting Generations
(The above is the percentage of used)
YGC: The number of young generations of YGC
YGCT: Time spent by young generation YGC
FGC: Number of old generation full GC
FGCT: Time spent on old generation full GC
GCT: Total time spent in GC
Jstat Dynamic view of garbage collection:
Collect data once every 3s clock, collect 10 times.