[讨论] 为何主动设置Xmx为3G了,老生代已经99%了,JVM内存还不会自动扩容,导致FullGC非常频繁,从top命令上看内存只用到1g
lin_yp
2012-12-21
为何主动设置Xmx为3G了,老生代已经99%了,JVM内存还不会自动扩容,导致FullGC非常频繁,从top命令上看内存只用到1g
如果改为-Xms3072m -Xmx3072m 一开始就直接分配3g的话,就没这个问题 但如果-Xms256m -Xmx3072m,问题就出现,FullGC非常频繁 查看了这2个参数也是默认的: MinHeapFreeRatio 40 MaxHeapFreeRatio 70 环境信息如下: 操作系统: Linux linux-wgvb 2.6.16.60-0.54.5-smp #1 SMP Fri Sep 4 01:28:03 UTC 2009 x86_64 x86_64 x86_64 GNU/Linux JDK版本: java version "1.6.0_32" Java(TM) SE Runtime Environment (build 1.6.0_32-b05) Java HotSpot(TM) 64-Bit Server VM (build 20.7-b02, mixed mode) JVM内存参数: -Xms256m -Xmx3072m -XX:+UseParallelOldGC -XX:MaxGCPauseMillis=1000 -XX:ParallelGCThreads=5 -Xrs -XX:PermSize=64m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError FullGC非常频繁: @linux> ./jstat -gcutil 18261 1000 500 S0 S1 E O P YGC YGCT FGC FGCT GCT 0.00 64.67 7.04 99.53 71.89 18293 510.574 1167 1616.594 2127.168 91.78 7.91 100.00 99.53 72.00 18299 510.821 1167 1616.594 2127.415 77.49 0.00 0.00 99.99 72.00 18300 510.947 1168 1616.594 2127.541 0.00 99.83 25.71 99.49 71.72 18305 511.178 1168 1617.915 2129.093 24.27 0.00 21.74 99.67 71.73 18310 511.342 1168 1617.915 2129.256 28.57 0.00 0.00 99.83 71.73 18314 511.427 1169 1617.915 2129.342 0.00 29.29 0.00 99.56 71.82 18317 511.465 1169 1618.919 2130.384 0.00 78.85 54.96 99.56 72.05 18326 511.777 1169 1618.919 2130.696 64.52 0.00 0.00 99.99 72.05 18328 511.920 1170 1618.919 2130.839 0.00 99.26 0.00 99.88 71.71 18333 512.079 1171 1620.014 2132.093 4.86 0.00 0.00 99.95 71.76 18338 512.255 1172 1620.957 2133.211 80.98 0.00 0.00 99.69 71.83 18350 512.453 1172 1621.906 2134.359 0.00 64.48 0.00 99.85 71.83 18355 512.677 1173 1621.906 2134.583 0.00 99.80 0.00 99.93 71.71 18359 512.876 1174 1623.264 2136.139 0.06 0.04 100.00 99.55 71.71 18360 512.876 1174 1624.193 2137.069 60.35 0.00 0.00 99.90 71.77 18376 513.429 1175 1624.193 2137.622 60.35 0.00 0.00 99.90 71.77 18376 513.429 1175 1624.193 2137.622 89.86 0.00 0.00 99.83 71.78 18384 513.839 1176 1625.476 2139.315 89.86 0.00 0.00 99.83 71.78 18384 513.839 1176 1625.476 2139.315 0.00 39.17 64.41 99.60 71.78 18394 514.202 1176 1626.880 2141.082 99.93 0.00 0.00 99.82 71.78 18396 514.326 1177 1626.880 2141.206 0.00 64.68 0.00 99.61 71.72 18401 514.409 1177 1627.945 2142.354 Top命令查看进程只用了1g内存,JVM没有自动扩容到Xmx: PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 18261 ouser 15 0 4353m 1.0g 52m S 325 3.2 271:25.52 java |
|
e456
2012-12-21
-Xrs 这个选项是干什么的?
|
|
lin_yp
2012-12-22
没有人知道这个问题什么原因吗?求 助R大
|
|
lin_yp
2012-12-22
linux-wgvb:> top
top - 14:32:06 up 8 days, 22:23, 7 users, load average: 12.30, 15.25, 16.44 Tasks: 344 total, 1 running, 343 sleeping, 0 stopped, 0 zombie Cpu(s): 35.3%us, 4.9%sy, 0.0%ni, 56.7%id, 3.0%wa, 0.0%hi, 0.1%si, 0.0%st Mem: 32165M total, 28204M used, 3960M free, 253M buffers Swap: 2055M total, 32M used, 2023M free, 18117M cached @linux-wgvb:> free total used free shared buffers cached Mem: 32937336 28831312 4106024 0 259396 18533164 -/+ buffers/cache: 10038752 22898584 Swap: 2104472 32864 2071608 |
|
RednaxelaFX
2012-12-23
麻烦贴一下GC频繁时的 jstat -gccapacity 和 jstat -gccause 的输出
|
|
lin_yp
2012-12-24
RednaxelaFX 写道 麻烦贴一下GC频繁时的 jstat -gccapacity 和 jstat -gccause 的输出
-Xms256m -Xmx3072m,问题就出现,FullGC非常频繁 jstat -gccapacity信息: NGCMN NGCMX NGC S0C S1C EC OGCMN OGCMX OGC OC PGCMN PGCMX PGC PC YGC FGC 87360.0 1048576.0 136256.0 65984.0 68096.0 64.0 174784.0 2097152.0 785664.0 785664.0 65536.0 524288.0 65792.0 65792.0 141612 8100 87360.0 1048576.0 122816.0 61376.0 12992.0 64.0 174784.0 2097152.0 791360.0 791360.0 65536.0 524288.0 65792.0 65792.0 141616 8100 87360.0 1048576.0 115264.0 57600.0 7872.0 64.0 174784.0 2097152.0 791936.0 791936.0 65536.0 524288.0 65792.0 65792.0 141617 8101 87360.0 1048576.0 112576.0 54912.0 56256.0 64.0 174784.0 2097152.0 797952.0 797952.0 65536.0 524288.0 65792.0 65792.0 141618 8102 87360.0 1048576.0 112576.0 54912.0 56256.0 64.0 174784.0 2097152.0 797952.0 797952.0 65536.0 524288.0 65792.0 65792.0 141618 8102 87360.0 1048576.0 105408.0 52672.0 192.0 64.0 174784.0 2097152.0 804096.0 804096.0 65536.0 524288.0 65792.0 65792.0 141621 8103 87360.0 1048576.0 87360.0 35584.0 38464.0 8064.0 174784.0 2097152.0 805568.0 805568.0 65536.0 524288.0 65792.0 65792.0 141629 8103 87360.0 1048576.0 111168.0 39488.0 46080.0 12416.0 174784.0 2097152.0 805568.0 805568.0 65536.0 524288.0 65792.0 65792.0 141635 8103 87360.0 1048576.0 142848.0 69440.0 70592.0 1664.0 174784.0 2097152.0 805568.0 805568.0 65536.0 524288.0 65792.0 65792.0 141644 8104 87360.0 1048576.0 142848.0 69440.0 70592.0 1664.0 174784.0 2097152.0 805568.0 805568.0 65536.0 524288.0 65792.0 65792.0 141644 8104 87360.0 1048576.0 87360.0 35136.0 37376.0 10304.0 174784.0 2097152.0 769280.0 769280.0 65536.0 524288.0 65792.0 65792.0 141661 8105 87360.0 1048576.0 87360.0 35136.0 34688.0 17536.0 174784.0 2097152.0 765184.0 765184.0 65536.0 524288.0 65792.0 65792.0 141663 8105 87360.0 1048576.0 150464.0 75200.0 69824.0 64.0 174784.0 2097152.0 765184.0 765184.0 65536.0 524288.0 65792.0 65792.0 141671 8106 87360.0 1048576.0 150464.0 75200.0 69824.0 64.0 174784.0 2097152.0 765184.0 765184.0 65536.0 524288.0 65792.0 65792.0 141671 8106 87360.0 1048576.0 105664.0 47936.0 42432.0 9792.0 174784.0 2097152.0 759360.0 759360.0 65536.0 524288.0 65792.0 65792.0 141693 8106 |
|
richard_2010
2013-01-21
gc log也贴一段出来看看好了
|
|
caoxudong818
2013-01-24
lin_yp 写道 RednaxelaFX 写道 麻烦贴一下GC频繁时的 jstat -gccapacity 和 jstat -gccause 的输出
-Xms256m -Xmx3072m,问题就出现,FullGC非常频繁 jstat -gccapacity信息: NGCMN NGCMX NGC S0C S1C EC OGCMN OGCMX OGC OC PGCMN PGCMX PGC PC YGC FGC 87360.0 1048576.0 136256.0 65984.0 68096.0 64.0 174784.0 2097152.0 785664.0 785664.0 65536.0 524288.0 65792.0 65792.0 141612 8100 87360.0 1048576.0 122816.0 61376.0 12992.0 64.0 174784.0 2097152.0 791360.0 791360.0 65536.0 524288.0 65792.0 65792.0 141616 8100 87360.0 1048576.0 115264.0 57600.0 7872.0 64.0 174784.0 2097152.0 791936.0 791936.0 65536.0 524288.0 65792.0 65792.0 141617 8101 87360.0 1048576.0 112576.0 54912.0 56256.0 64.0 174784.0 2097152.0 797952.0 797952.0 65536.0 524288.0 65792.0 65792.0 141618 8102 87360.0 1048576.0 112576.0 54912.0 56256.0 64.0 174784.0 2097152.0 797952.0 797952.0 65536.0 524288.0 65792.0 65792.0 141618 8102 87360.0 1048576.0 105408.0 52672.0 192.0 64.0 174784.0 2097152.0 804096.0 804096.0 65536.0 524288.0 65792.0 65792.0 141621 8103 87360.0 1048576.0 87360.0 35584.0 38464.0 8064.0 174784.0 2097152.0 805568.0 805568.0 65536.0 524288.0 65792.0 65792.0 141629 8103 87360.0 1048576.0 111168.0 39488.0 46080.0 12416.0 174784.0 2097152.0 805568.0 805568.0 65536.0 524288.0 65792.0 65792.0 141635 8103 87360.0 1048576.0 142848.0 69440.0 70592.0 1664.0 174784.0 2097152.0 805568.0 805568.0 65536.0 524288.0 65792.0 65792.0 141644 8104 87360.0 1048576.0 142848.0 69440.0 70592.0 1664.0 174784.0 2097152.0 805568.0 805568.0 65536.0 524288.0 65792.0 65792.0 141644 8104 87360.0 1048576.0 87360.0 35136.0 37376.0 10304.0 174784.0 2097152.0 769280.0 769280.0 65536.0 524288.0 65792.0 65792.0 141661 8105 87360.0 1048576.0 87360.0 35136.0 34688.0 17536.0 174784.0 2097152.0 765184.0 765184.0 65536.0 524288.0 65792.0 65792.0 141663 8105 87360.0 1048576.0 150464.0 75200.0 69824.0 64.0 174784.0 2097152.0 765184.0 765184.0 65536.0 524288.0 65792.0 65792.0 141671 8106 87360.0 1048576.0 150464.0 75200.0 69824.0 64.0 174784.0 2097152.0 765184.0 765184.0 65536.0 524288.0 65792.0 65792.0 141671 8106 87360.0 1048576.0 105664.0 47936.0 42432.0 9792.0 174784.0 2097152.0 759360.0 759360.0 65536.0 524288.0 65792.0 65792.0 141693 8106 为便于观察,用上面的数据做几张图。图片生产地址在这里。坐等高人来解惑。 ![]() ![]() ![]() 为啥Javaeye就不开放群组直接上传图片的功能呢? ![]() |