0

我有一个问题:Eden 100% used,Old 100% used,From Space 100% used,但没有触发垃圾收集,没有 oom

jmap -heap [pid] 结果

Eden Space:    
capacity = 859045888 (819.25MB)    
used     = 859045888(819.25MB)   
free     = 0 (0.0MB)
100.0% used 
From Space:    
capacity = 107347968 (102.375MB)    
used     = 12370032(11.796981811523438MB)    
free     = 16441280 (90.57801818847656MB)
0.0% used 
To Space:    
capacity = 107347968 (102.375MB)   
used     = 0 (0.0MB)    
free     = 107347968 (102.375MB)
 0.0% used 
PS Old generation:    
capacity = 1073741824 (1024.0MB)   
used     = 1073741816 (1023.0832290649414MB)    
free     = 8 (7.62399453125E-6MB)
 99.99999925494154% used 
Perm Generation:    
capacity = 268435456 (256.0MB)    
used     = 79784056 (76.08800506591797MB)    
free     = 188651400 (179.91199493408203MB)
 29.721876978874207% used

jstat -gcutil [pid] 1000
   S0     S1     E      O      P     YGC   YGCT    FGC    FGCT     GCT
  11.52  0.00  100.00  100.00  30.28  22   5.87     3    6.136    11.723
  11.52  0.00  100.00  100.00  30.28  22   5.87     3    6.136    11.723
  11.52  0.00  100.00  100.00  30.28  22   5.87     3    6.136    11.723
  11.52  0.00  100.00  100.00  30.28  22   5.87     3    6.136    11.723
  11.52  0.00  100.00  100.00  30.28  22   5.87     3    6.136    11.723
  11.52  0.00  100.00  100.00  30.28  22   5.87     3    6.136    11.723

我的虚拟机参数是

-Xmx2g -Xms2g -Xmn1g -XX:SurvivorRatio=8 -XX:PermSize=256m -XX:MaxPermSize=256m -XX:+HeapDumpOnOutOfMemoryError -XX:ReservedCodeCacheSize=128m -XX:InitialCodeCacheSize=128m -XX:+DisableExplicitGC -XX:+ PrintGCDetails -XX:+PrintGCDateStamps -XX:+PrintGCTimeStamps -XX:+PrintHeapAtGC -XX:+PrintTenuringDistribution -XX:+UseConcMarkSweepGC -XX:+UseCMSCompactAtFullCollection -XX:CMSFullGCsBeforeCompaction=0 -XX:CMSInitiatingOccupancyFraction=80

如何解决?

4

1 回答 1

1

为什么如此复杂jvm parameters(您缺少-Xloggc:/path/to/file避免只是冗长的日志记录)。

我发现真的很难相信没有GC被触发。如果我是你,你会从一个更容易理解的选项开始,然后从那里迭代。请记住,在大多数情况下,只需设置XmsXmx足够了。因为heap是基于比率和人体工程学做剩下的。

于 2013-08-05T15:22:53.797 回答