GC暂停5秒,但标记,扫描和压缩不到1秒

时间:2015-10-22 12:41:20

标签: java garbage-collection jvm aix

我有一个AIX服务器使用gencon GC策略运行具有8 GB堆的JVM进程。今天我有5s暂停时间,这是令人担忧的。我查看了GC日志中的事件,但无法确定所有时间花在哪里。

<con event="collection" id="1" timestamp="Oct 22 13:34:10 2015" intervalms="0.000">   <time exclusiveaccessms="0.195" />   <nursery freebytes="871692288" totalbytes="966367232" percent="90" />   <tenured freebytes="375809024" totalbytes="7516192768" percent="4" >
    <soa freebytes="0" totalbytes="7140383744" percent="0" />
    <loa freebytes="375809024" totalbytes="375809024" percent="100" />   </tenured>   <stats tracetarget="2430736896">
    <traced total="2804446392" mutators="2591437504" helpers="213008888" percent="115" />
    <cards cleaned="1874" kickoff="102056216" />   </stats>   <con event="remembered set scan">
    <stats objectsfound="17649" traced="110458224" timetakenms="129.797" />   </con>   <con event="final card cleaning">
    <stats cardscleaned="334" traced="9118008" durationms="7.732" />   </con>   <gc type="global" id="1" totalid="929" intervalms="0.000">
    <classloadersunloaded count="162267" timetakenms="4957.805" />
    <refs_cleared soft="1942" threshold="32" weak="164659" phantom="0" />
    <finalization objectsqueued="120" />
    ***<timesms mark="258.390" sweep="33.125" compact="0.000" total="5267.373" />***
    <nursery freebytes="904360200" totalbytes="966367232" percent="93" />
    <tenured freebytes="3848182720" totalbytes="7516192768" percent="51" >
      <soa freebytes="3472373696" totalbytes="7140383744" percent="48" />
      <loa freebytes="375809024" totalbytes="375809024" percent="100" />
    </tenured>   </gc>   <nursery freebytes="904360200" totalbytes="966367232" percent="93" />   <tenured freebytes="3848182720" totalbytes="7516192768" percent="51" >
    <soa freebytes="3472373696" totalbytes="7140383744" percent="48" />
    <loa freebytes="375809024" totalbytes="375809024" percent="100" />   </tenured>   <time totalms="5406.538" /> </con>

如何找到完整GC的哪个活动部分占用大部分暂停时间?

由于

2 个答案:

答案 0 :(得分:3)

扫描类加载器所花费的时间总计不计算在内:

<classloadersunloaded count="162267" timetakenms="4957.805" />

内存中有162267个类加载器需要4957.805ms才能扫描。这似乎是已知的问题,解决方法和修复程序在这里:http://www-01.ibm.com/support/docview.wss?uid=swg1IZ76742

答案 1 :(得分:1)

您没有附加任何示例GC日志,但根据您的说明,您正在运行CMS收集器。长时间暂停通常是由完整的GC引起的,有时候这个收集器会发生 - 它主要是并发的。我建议在有问题的时间上传一些示例GC日志,并查看这篇名为&#39; Understanding CMS GC Logs&#39;

的文章。