简体   繁体   中英

UseConcMarkSweepGC verbose gc output shows memory drops

I have an application for which I have enabled GC logging. The heap appears to grow then takes a sudden drop, but does not log a Full GC. If there some startup parameter that I can enable that will show me what GC event is reducing the heap size?

My environment: Linux 64-Bit, java 1.6.0_31, Java HotSpot(TM) 64-Bit Server VM (build 20.6-b01, mixed mode)

VM args: -server -Xms2560m -Xmx2560m -XX:+UseConcMarkSweepGC -XX:MaxPermSize=256m -XX:-PrintGC -XX: -PrintGCDetails -XX:-PrintGCTimeStamps -Xloggc:/xxxxx/gc.log -Dsun.rmi.dgc.client.gcInterval=86400000 -Dsun.rmi.dgc.server.gcInterval=86400000

3057.609: [GC 2397254K->2385777K(2619328K), 0.0572310 secs]
3058.898: [GC 2402801K->2391301K(2619328K), 0.0566620 secs]
3059.940: [GC 2408325K->2397156K(2619328K), 0.0534080 secs]
3059.995: [GC 2397265K(2619328K), 0.0069950 secs]
3065.635: [GC 2414180K->2404934K(2619328K), 0.0732700 secs]
3065.849: [GC 2419994K(2619328K), 0.1150630 secs]
3070.248: [GC 1593931K->1591825K(2619328K), 0.1084230 secs]
3072.440: [GC 1608552K->1606431K(2619328K), 0.0533140 secs]
3087.759: [GC 1623455K->1614544K(2619328K), 0.0215850 secs]

What event is causing the heap to shrink between the output at 3065.849 and 3070.248? Is there a VM param that will log it? I tried adding -verbose:gc but that does not change the output.

GC happens in two steps

1) Minor collection (cleans mostly younger generation)

2) Major collection

I guess what you are seeing there is minor collection. This tutorial may help you in understanding these terminologies.

Mark's comment had the right answer, I was not enabling the Details properly. Now I see the event:

5505.399: [GC 5505.399: [DefNew: 17273K->1942K(19136K), 0.0172730 secs] 2408937K->2393606K(2619328K), 0.0175180 secs] [Times: user=0.01 sys=0.00, real=0.01 secs]
5524.922: [GC 5524.922: [DefNew: 18948K->2111K(19136K), 0.0268990 secs] 2410612K->2395349K(2619328K), 0.0271850 secs] [Times: user=0.02 sys=0.01, real=0.03 secs]
5524.950: [GC [1 CMS-initial-mark: 2393237K(2600192K)] 2395413K(2619328K), 0.0088880 secs] [Times: user=0.01 sys=0.00, real=0.01 secs]
5524.959: [CMS-concurrent-mark-start]
5527.608: [CMS-concurrent-mark: 2.645/2.650 secs] [Times: user=2.62 sys=0.00, real=2.65 secs]
5527.609: [CMS-concurrent-preclean-start]
5527.624: [CMS-concurrent-preclean: 0.015/0.015 secs] [Times: user=0.01 sys=0.00, real=0.01 secs]
5527.625: [GC[YG occupancy: 3557 K (19136 K)]5527.625: [Rescan (non-parallel) 5527.625: [grey object rescan, 0.0065690 secs]5527.632: [root rescan, 0.0088130 secs], 0.0154260 secs]5527.641: [weak refs processing, 0.1026480 secs] [1 CMS-remark: 2393237K(2600192K)] 2396795K(2619328K), 0.1252390 secs] [Times: user=0.13 sys=0.00, real=0.13 secs]
5527.954: [CMS-concurrent-sweep-start]
5531.258: [CMS-concurrent-sweep: 3.304/3.304 secs] [Times: user=3.15 sys=0.02, real=3.30 secs]
5531.258: [CMS-concurrent-reset-start]
5531.264: [CMS-concurrent-reset: 0.006/0.006 secs] [Times: user=0.01 sys=0.00, real=0.01 secs]  
5551.660: [GC 5551.660: [DefNew: 19135K->1234K(19136K), 0.0691830 secs] 1373830K->1357833K(2619328K), 0.0694780 secs] [Times: user=0.07 sys=0.00, real=0.07 secs]
5584.991: [GC 5584.991: [DefNew: 18257K->2111K(19136K), 0.0264920 secs] 1374857K->1360277K(2619328K), 0.0267850 secs] [Times: user=0.02 sys=0.00, real=0.02 secs]
5589.794: [GC 5589.794: [DefNew: 19135K->286K(19136K), 0.0189210 secs] 1377301K->1359264K(2619328K), 0.0191450 secs] [Times: user=0.02 sys=0.00, real=0.02 secs]
5632.424: [GC 5632.424: [DefNew: 17310K->2111K(19136K), 0.0182480 secs] 1376288K->1361326K(2619328K), 0.0185900 secs] [Times: user=0.02 sys=0.00, real=0.02 secs]
5645.086: [GC 5645.087: [DefNew: 19135K->2112K(19136K), 0.0276910 secs] 1378350K->1363056K(2619328K), 0.0279740 secs] [Times: user=0.03 sys=0.00, real=0.03 secs]

Thanks.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM