记一次内存撑爆故障分析

初步定位,太多对象进入老年代

[root@VM_0_12_centos /]# jmap -heap 19751
Attaching to process ID 19751, please wait...
Debugger attached successfully.
Server compiler detected.
JVM version is 25.151-b12

using thread-local object allocation.
Parallel GC with 2 thread(s)

Heap Configuration:
   MinHeapFreeRatio         = 0
   MaxHeapFreeRatio         = 100
   MaxHeapSize              = 994050048 (948.0MB)
   NewSize                  = 20971520 (20.0MB)
   MaxNewSize               = 331350016 (316.0MB)
   OldSize                  = 41943040 (40.0MB)
   NewRatio                 = 2
   SurvivorRatio            = 8
   MetaspaceSize            = 21807104 (20.796875MB)
   CompressedClassSpaceSize = 1073741824 (1024.0MB)
   MaxMetaspaceSize         = 17592186044415 MB
   G1HeapRegionSize         = 0 (0.0MB)

Heap Usage:
PS Young Generation
Eden Space:
   capacity = 311427072 (297.0MB)
   used     = 19264464 (18.372024536132812MB)
   free     = 292162608 (278.6279754638672MB)
   6.185866847182766% used
From Space:
   capacity = 9961472 (9.5MB)
   used     = 0 (0.0MB)
   free     = 9961472 (9.5MB)
   0.0% used
To Space:
   capacity = 9961472 (9.5MB)
   used     = 0 (0.0MB)
   free     = 9961472 (9.5MB)
   0.0% used
PS Old Generation
   capacity = 76021760 (72.5MB)
   used     = 27297312 (26.032745361328125MB)
   free     = 48724448 (46.467254638671875MB)
   35.90723498114224% used

21030 interned Strings occupying 2561000 bytes.

 

参考:

 

通过 jstack 与 jmap 分析一次线上故障(推荐)

MAT工具(推荐)

JVM调优总结(很全,但也很杂乱)

linux下java程序占用CPU和内存过高排错处理方案(对我很有用)

你可能感兴趣的:(Java)