在我们的GC日志中,我们看到这种模式会延长一段时间(20多分钟)。以下是在此期间运行的Full GC的小快照:
2017-08-17T17:40:55.958-0500: 2263.468: [Full GC [PSYoungGen: 200192K->200191K(272896K)] [ParOldGen: 698843K->698835K(698880K)] 899035K->899026K(971776K) [PSPermGen: 26732K->26732K(26880K)], 0.3358980 secs] [Times: user=12.79 sys=0.03, real=0.33 secs]
2017-08-17T17:40:56.294-0500: 2263.805: [Full GC [PSYoungGen: 200192K->200191K(272896K)] [ParOldGen: 698835K->698835K(698880K)] 899027K->899027K(971776K) [PSPermGen: 26732K->26732K(26880K)], 0.4146470 secs] [Times: user=14.99 sys=0.04, real=0.42 secs]
2017-08-17T17:40:56.710-0500: 2264.220: [Full GC [PSYoungGen: 200192K->200191K(272896K)] [ParOldGen: 698835K->698835K(698880K)] 899027K->899027K(971776K) [PSPermGen: 26732K->26732K(26880K)], 0.3549330 secs] [Times: user=14.16 sys=0.03, real=0.35 secs]
2017-08-17T17:40:57.065-0500: 2264.576: [Full GC [PSYoungGen: 200191K->200191K(272896K)] [ParOldGen: 698835K->698835K(698880K)] 899027K->899027K(971776K) [PSPermGen: 26732K->26732K(26880K)], 0.3333880 secs] [Times: user=12.86 sys=0.04, real=0.34 secs]
2017-08-17T17:40:57.399-0500: 2264.910: [Full GC [PSYoungGen: 200191K->200191K(272896K)] [ParOldGen: 698843K->698835K(698880K)] 899035K->899027K(971776K) [PSPermGen: 26732K->26732K(26880K)], 0.3361300 secs] [Times: user=13.10 sys=0.04, real=0.33 secs]
2017-08-17T17:40:57.736-0500: 2265.246: [Full GC [PSYoungGen: 200191K->200191K(272896K)] [ParOldGen: 698845K->698835K(698880K)] 899037K->899027K(971776K) [PSPermGen: 26732K->26732K(26880K)], 0.3165070 secs] [Times: user=11.66 sys=0.03, real=0.32 secs]
2017-08-17T17:40:58.053-0500: 2265.564: [Full GC [PSYoungGen: 200191K->200191K(272896K)] [ParOldGen: 698835K->698834K(698880K)] 899027K->899026K(971776K) [PSPermGen: 26732K->26732K(26880K)], 0.3860970 secs] [Times: user=15.29 sys=0.09, real=0.39 secs]
2017-08-17T17:40:58.440-0500: 2265.951: [Full GC [PSYoungGen: 200192K->200191K(272896K)] [ParOldGen: 698834K->698834K(698880K)] 899026K->899026K(971776K) [PSPermGen: 26732K->26732K(26880K)], 0.3679940 secs] [Times: user=14.06 sys=0.04, real=0.37 secs]
2017-08-17T17:40:58.809-0500: 2266.319: [Full GC [PSYoungGen: 200192K->200191K(272896K)] [ParOldGen: 698834K->698834K(698880K)] 899026K->899026K(971776K) [PSPermGen: 26732K->26732K(26880K)], 0.3336190 secs] [Times: user=12.92 sys=0.03, real=0.33 secs]
2017-08-17T17:40:59.143-0500: 2266.654: [Full GC [PSYoungGen: 200192K->200191K(272896K)] [ParOldGen: 698834K->698834K(698880K)] 899026K->899026K(971776K) [PSPermGen: 26732K->26732K(26880K)], 0.3498820 secs] [Times: user=13.31 sys=0.04, real=0.35 secs]
2017-08-17T17:40:59.494-0500: 2267.004: [Full GC [PSYoungGen: 200192K->200191K(272896K)] [ParOldGen: 698834K->698834K(698880K)] 899026K->899026K(971776K) [PSPermGen: 26732K->26732K(26880K)], 0.3055050 secs] [Times: user=11.00 sys=0.04, real=0.31 secs]
2017-08-17T17:40:59.800-0500: 2267.310: [Full GC [PSYoungGen: 200192K->200191K(272896K)] [ParOldGen: 698834K->698834K(698880K)] 899026K->899026K(971776K) [PSPermGen: 26732K->26732K(26880K)], 0.3235970 secs] [Times: user=12.22 sys=0.05, real=0.32 secs]
因此,我们每秒都有多次运行Full GC,这个JVM几乎没有时间做任何实际的工作。我们尝试设置以下参数来强制执行" GC开销"发生这种情况时的OOM:
-XX:GCTimeLimit=5
-XX:GCHeapFreeLimit=50
以下是有关这些文档的Oracle文档以供参考:https://docs.oracle.com/javase/8/docs/technotes/guides/vm/gc-ergonomics.html
我会考虑使用这些设置(> 5%的时间用于GC,<50%堆免费),我们将触发OutOfMemoryError:超出GC Overhead限制。关于为什么这不会像我们期望的那样触发的任何想法?
编辑 - 更多信息,这里是GC日志的顶部,显示版本信息,参数等:
Java HotSpot(TM) Server VM (24.101-b14) for linux-x86 JRE (1.7.0_101-b14), built on Mar 31 2016 05:26:20 by "java_re" with gcc 4.3.0 20080428 (Red Hat 4.3.0-8)
Memory: 4k page, physical 131954348k(1343412k free), swap 125812704k(125512524k free)
CommandLine flags: -XX:GCHeapFreeLimit=50 -XX:GCTimeLimit=5 -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/cerner/core_files -XX:InitialHeapSize=446693376 -XX:MaxHeapSize=1073741824 -XX:OnOutOfMemoryError=/usr/local/cwx/ejs_oom.ksh -XX:+PrintGC -XX:+PrintGCApplicationStoppedTime -XX:+PrintGCDateStamps -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintHeapAtGC -XX:+UseParallelGC
答案 0 :(得分:0)
一种可能性是您已使用-XX:-UseGCOverheadLimit
编辑 - 更多信息,这里是GC日志的顶部,显示版本信息,参数等:
-XX:GCTimeLimit=0
这显然不是你说你设定的选项。