UseConcMarkSweepGC与UseParallelGC [英] UseConcMarkSweepGC vs UseParallelGC

查看:2468
本文介绍了UseConcMarkSweepGC与UseParallelGC的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前在很长的垃圾收集时间方面遇到问题。请看下面的内容。我目前的设置是我正在使用-Xms1g和-Xmx3g。我的应用程序正在使用Java 1.4.2。我没有设置垃圾收集标志。通过它的外观,3GB是不够的,我真的有很多对象垃圾收集。



问题:

我应该改变我的垃圾收集算法吗?
我应该使用什么?使用 -XX:+ UseParallelGC或-XX:+ UseConcMarkSweepGC



更好吗?还是应该使用这种组合

  -XX:+ UseParNewGC -XX:+ UseConcMarkSweepGC 

占用内存的那些主要是报告数据而不是缓存数据。此外,该机器有16GB的内存,我打算增加到8GB的堆。

这两个选项之间有什么区别,因为我仍然觉得很难理解。
机器有多个处理器。我可以接受高达5秒的命中,但30到70秒真的很难。



感谢您的帮助。



警告(8710):CORE3283:stderr:[GC 1632936K-> 1020739K(2050552K),1.2462436秒]
Line 157710:[14 / Jan / 2012:11:53:38]警告(8710):CORE3283:stderr:[GC 1670531K-> 1058755K(2050552K),1.1555375秒]
Line 163840 :警告(8710):CORE3283:stderr:[GC 1708547K-> 1097282K(2050552K),1.1503118秒]
Line 169811:[14 / Jan / 2012 :12:08:02]警告(8710):CORE3283:stderr:[GC 1747074K-> 1133764K(2050552K),1.1017273秒]
175879行:[14 / Jan / 2012:12:14:18]警告(8710):CORE3283:stderr:[GC 1783556K-> 1173103K(2050552K),1.2060946秒]
176606行:[14 / Jan / 2012:12:15:42]警告(8710):CORE3283: stderr:[Full GC 1265571K-> 1124875K(2050552K),25.0670316 secs]
Line 184755:[14 / Jan / 2012:12:25:53]警告(8710):COR E3283:stderr:[GC 2007435K-> 1176457K(2784880K),1.2483770 secs]
Line 193087:[14 / Jan / 2012:12:37:09]警告(8710):CORE3283:stderr:[GC 2059017K (8710):CORE3283:stderr:[Full GC 2106845K-> 1215242K(2784880K) - > 1224285K ),30.4016208 secs]


xaa:1:[11 / Oct / 2011:16:00:28]警告(17125):CORE3283:stderr:[Full GC 3114936K-> 2985477K(3114944K),53.0468651秒] - >垃圾收集发生的时间过于频繁。被收集的垃圾非常低,如果你会注意到堆的大小非常接近。在53秒内,这相当于暂停。
xaa:2087:[11 / Oct / 2011:16:01:35]警告(17125):CORE3283:stderr:[Full GC 3114943K-> 2991338K(3114944K),58.3776291秒]
xaa警告(17125):CORE3283:stderr:[Full GC 3114940K-> 2997077K(3114944K),55.3197974 secs]
xaa:5597:[11 / Oct / 2011:16:03:00]警告(17125):CORE3283:stderr:[Full GC [卸载类sun.reflect.GeneratedConstructorAccessor119]
xaa:7936:[11 / Oct / 2011:16:04 :警告(17125):CORE3283:stderr:[Full GC 3114938K-> 3004947K(3114944K),55.5269911 secs]
xaa:9070:[11 / Oct / 2011:16:05:53]警告17125):CORE3283:stderr:[Full GC 3114937K-> 3012793K(3114944K),70.6993328 secs]


解决方案

由于GC停顿时间过长,因此不认为改变GC算法会有所帮助。



请注意,可疑你只有完整的收藏。也许你需要增加年轻一代和/或幸存者的空间。

另见:


I'm currently having problems with very long garbage collection times. please see the followig. My current setup is that I'm using a -Xms1g and -Xmx3g. my application is using java 1.4.2. I don't have any garbage collection flags set. by the looks of it, 3gb is not enough and I really have a lot of objects to garbage collect.

question:

should I change my garbage collection algorithm? what should i use? is it better to use -XX:+UseParallelGC or -XX:+UseConcMarkSweepGC

or should i use this combination

-XX:+UseParNewGC -XX:+UseConcMarkSweepGC

the ones occupying the memory are largely reports data and not cache data. also, the machine has 16gb memory and I plan to increase the heap to 8gb.

What are the difference between the two options as I still find it hard to understand. the machine has multiple processors. I can take hits of up to 5 seconds but 30 to 70 seconds is really hard.

Thanks for the help.

  Line 151493: [14/Jan/2012:11:47:48] WARNING ( 8710): CORE3283: stderr: [GC 1632936K->1020739K(2050552K), 1.2462436 secs]
    Line 157710: [14/Jan/2012:11:53:38] WARNING ( 8710): CORE3283: stderr: [GC 1670531K->1058755K(2050552K), 1.1555375 secs]
    Line 163840: [14/Jan/2012:12:00:42] WARNING ( 8710): CORE3283: stderr: [GC 1708547K->1097282K(2050552K), 1.1503118 secs]
    Line 169811: [14/Jan/2012:12:08:02] WARNING ( 8710): CORE3283: stderr: [GC 1747074K->1133764K(2050552K), 1.1017273 secs]
    Line 175879: [14/Jan/2012:12:14:18] WARNING ( 8710): CORE3283: stderr: [GC 1783556K->1173103K(2050552K), 1.2060946 secs]
    Line 176606: [14/Jan/2012:12:15:42] WARNING ( 8710): CORE3283: stderr: [Full GC 1265571K->1124875K(2050552K), 25.0670316 secs]
    Line 184755: [14/Jan/2012:12:25:53] WARNING ( 8710): CORE3283: stderr: [GC 2007435K->1176457K(2784880K), 1.2483770 secs]
    Line 193087: [14/Jan/2012:12:37:09] WARNING ( 8710): CORE3283: stderr: [GC 2059017K->1224285K(2784880K), 1.4739291 secs]
    Line 201377: [14/Jan/2012:12:51:08] WARNING ( 8710): CORE3283: stderr: [Full GC 2106845K->1215242K(2784880K), 30.4016208 secs]


xaa:1: [11/Oct/2011:16:00:28] WARNING (17125): CORE3283: stderr: [Full GC 3114936K->2985477K(3114944K), 53.0468651 secs] --> garbage collection occurring too often as noticed in the time. garbage being collected is quite low and if you would notice is quite close the the heap size. during the 53 seconds, this is equivalent to a pause.
xaa:2087: [11/Oct/2011:16:01:35] WARNING (17125): CORE3283: stderr: [Full GC 3114943K->2991338K(3114944K), 58.3776291 secs]
xaa:3897: [11/Oct/2011:16:02:33] WARNING (17125): CORE3283: stderr: [Full GC 3114940K->2997077K(3114944K), 55.3197974 secs]
xaa:5597: [11/Oct/2011:16:03:00] WARNING (17125): CORE3283: stderr: [Full GC[Unloading class sun.reflect.GeneratedConstructorAccessor119]
xaa:7936: [11/Oct/2011:16:04:36] WARNING (17125): CORE3283: stderr: [Full GC 3114938K->3004947K(3114944K), 55.5269911 secs]
xaa:9070: [11/Oct/2011:16:05:53] WARNING (17125): CORE3283: stderr: [Full GC 3114937K->3012793K(3114944K), 70.6993328 secs]

解决方案

Since you have extremenly long GC pauses, it's don't think that changing GC algorithm would help.

Note that it's highly suspicious that you have only full collections. Perhaps you need to increase the size of young generation and/or survivor space.

See also:

这篇关于UseConcMarkSweepGC与UseParallelGC的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆