JVM在不同的收集器下,SurvivorRatio都设为2,eden和servivor的比例不一样?

megapentakill 发布于 2017/07/30 18:03
阅读 428
收藏 0

SurvivorRatio都设为2,分别使用-XX:+UseSerialGC串行收集器,和-XX:+UseParallelOldGC并行收集器。

def new generation   total 768K, used 523K [0x00000000fec00000, 0x00000000fed00000, 0x00000000fed00000)
  eden space 512K,  89% used [0x00000000fec00000, 0x00000000fec72f38, 0x00000000fec80000)
  from space 256K,  24% used [0x00000000fec80000, 0x00000000fec8fff8, 0x00000000fecc0000)
  to   space 256K,   0% used [0x00000000fecc0000, 0x00000000fecc0000, 0x00000000fed00000)

 

PSYoungGen      total 1024K, used 859K [0x00000000ffe80000, 0x0000000100000000, 0x0000000100000000)
  eden space 512K, 89% used [0x00000000ffe80000,0x00000000ffef2f38,0x00000000fff00000)
  from space 512K, 78% used [0x00000000fff80000,0x00000000fffe4010,0x0000000100000000)
  to   space 512K, 0% used [0x00000000fff00000,0x00000000fff00000,0x00000000fff80000)

 

在看实战JAVA虚拟机这本书,按照书中列子试了试,发现跟书中不同,百度也没有找到相关资料

加载中
0
x
xiaogan120

 

JDK1.7我的执行结果,具体配置参数是什么?

-ea -XX:SurvivorRatio=2  -XX:+PrintGCDetails  -XX:ParallelGCThreads=20 -XX:+UseParallelGC

Heap
 PSYoungGen      total 31744K, used 13437K [0x00000007d6f00000, 0x00000007dad00000, 0x0000000800000000)
  eden space 21504K, 45% used [0x00000007d6f00000,0x00000007d78a6108,0x00000007d8400000)
  from space 10240K, 34% used [0x00000007d8400000,0x00000007d8779510,0x00000007d8e00000)
  to   space 10240K, 0% used [0x00000007da300000,0x00000007da300000,0x00000007dad00000)
 ParOldGen       total 83968K, used 80K [0x0000000784e00000, 0x000000078a000000, 0x00000007d6f00000)
  object space 83968K, 0% used [0x0000000784e00000,0x0000000784e14010,0x000000078a000000)
 PSPermGen       total 21504K, used 17383K [0x000000077fc00000, 0x0000000781100000, 0x0000000784e00000)
  object space 21504K, 80% used [0x000000077fc00000,0x0000000780cf9e38,0x0000000781100000)

-ea -XX:SurvivorRatio=2  -XX:+PrintGCDetails  -XX:+UseSerialGC
Heap
 def new generation   total 31488K, used 14770K [0x000000077fc00000, 0x0000000782500000, 0x00000007a8ca0000)
  eden space 20992K,  54% used [0x000000077fc00000, 0x0000000780740888, 0x0000000781080000)
  from space 10496K,  30% used [0x0000000781ac0000, 0x0000000781dec030, 0x0000000782500000)
  to   space 10496K,   0% used [0x0000000781080000, 0x0000000781080000, 0x0000000781ac0000)
 tenured generation   total 84096K, used 0K [0x00000007a8ca0000, 0x00000007adec0000, 0x00000007fae00000)
   the space 84096K,   0% used [0x00000007a8ca0000, 0x00000007a8ca0000, 0x00000007a8ca0200, 0x00000007adec0000)
 compacting perm gen  total 21248K, used 17383K [0x00000007fae00000, 0x00000007fc2c0000, 0x0000000800000000)
   the space 21248K,  81% used [0x00000007fae00000, 0x00000007fbef9ea8, 0x00000007fbefa000, 0x00000007fc2c0000)
No shared spaces configured.


-ea -XX:SurvivorRatio=2  -XX:+PrintGCDetails  -XX:+UseParallelOldGC
Heap
 PSYoungGen      total 31744K, used 13892K [0x00000007d6f00000, 0x00000007dad00000, 0x0000000800000000)
  eden space 21504K, 48% used [0x00000007d6f00000,0x00000007d7923e60,0x00000007d8400000)
  from space 10240K, 34% used [0x00000007d8400000,0x00000007d876d500,0x00000007d8e00000)
  to   space 10240K, 0% used [0x00000007da300000,0x00000007da300000,0x00000007dad00000)
 ParOldGen       total 83968K, used 88K [0x0000000784e00000, 0x000000078a000000, 0x00000007d6f00000)
  object space 83968K, 0% used [0x0000000784e00000,0x0000000784e16010,0x000000078a000000)
 PSPermGen       total 21504K, used 17384K [0x000000077fc00000, 0x0000000781100000, 0x0000000784e00000)
  object space 21504K, 80% used [0x000000077fc00000,0x0000000780cfa0d8,0x0000000781100000)

返回顶部
顶部