由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Java版 - garbage collection issue
相关主题
Java都在什么时候进行Garbage collection?Re: Out of memory, Java heap space 的问题怎么解决? (转载)
Java/J2EE的面试中,关于garbage collection的问题应该怎么回答?OutofMemoryError: Java Heap Space
Java StringBuilder myth debunked求教有没有好的查memory leak的工具?
java最大用多少内存请教一个javascript的heap的问题。
菜鸟请教jsp和ejbarray 在java里 是一定放在heap 吗?
An experiment with JVM Garbage Collection SchemesJava Object 一定在 Heap 里吗
jar file question被面how to manage heap in java jvm
Another garbage collection questiona garbage collection question
相关话题的讨论汇总
话题: gc话题: jvm话题: garbage话题: collection话题: seconds
进入Java版参与讨论
1 (共1页)
o*******a
发帖数: 46
1
I set the -Xmax=12g. At initial launch, garbage collection happens when
young generation reaches around 3G, gc time takes around 0.5 seconds, the
interval between gc is 5minutes. After running a few days, gc happens much
more often than before, now every few seconds, there is a gc happening. The
good thing is that it took very short-- 0.05 seconds. I am just curious
about why JVM kick off gc that often.
Can anyone shed some light on it?
beginning:
97.788: [GC [PSYoungGen: 3036448K->643872K(33088
b******y
发帖数: 9224
2
No idea yet. What kind of tool you used for profiling the java GC process?
It might be your application has frequent memory allocation and deallocation
going on?
m******t
发帖数: 2416
3

The
If you are this concerned about gc, there is a whole sleu of
-XX GC tuning options to play with:
http://java.sun.com/javase/technologies/hotspot/vmoptions.jsp
For instance one thing you might want to look at is -XX:SurviverRatio
which lets you adjust how big the young gen according to your
app's memory usage pattern.

【在 o*******a 的大作中提到】
: I set the -Xmax=12g. At initial launch, garbage collection happens when
: young generation reaches around 3G, gc time takes around 0.5 seconds, the
: interval between gc is 5minutes. After running a few days, gc happens much
: more often than before, now every few seconds, there is a gc happening. The
: good thing is that it took very short-- 0.05 seconds. I am just curious
: about why JVM kick off gc that often.
: Can anyone shed some light on it?
: beginning:
: 97.788: [GC [PSYoungGen: 3036448K->643872K(33088

i****k
发帖数: 804
4
12g 的heap太大了。不知道你的APP是什么。如果是需要支持很多用户的WEB,正确的方
法是考虑用cluster, horizontally scale up。
目前的JVM,对12G这么大的HEAP都会出现性能病态。你肯定是在用64位JVM。64位JVM本
身目前也普遍比32位JVM慢20 ~ 25%左右。多数厂商建议即使在64位OS上也要用32位
JVM。
如果用32位JVM,在3G左右还是频繁OLD GEN GC,那么你的APP应该是病态的,需要
PROFILE什么类的对象被频繁分配和GC,是否有大STRING对象被频繁分配( String +
String 之类的code),是否有大块数据频繁被IO。针对这些情况,考虑用FLYWEIGHT一
类的设计模式,用StringBuffer,用cache strategy。下载一个免费试用的工具
YourKit,解决这类问题很有效。

The

【在 o*******a 的大作中提到】
: I set the -Xmax=12g. At initial launch, garbage collection happens when
: young generation reaches around 3G, gc time takes around 0.5 seconds, the
: interval between gc is 5minutes. After running a few days, gc happens much
: more often than before, now every few seconds, there is a gc happening. The
: good thing is that it took very short-- 0.05 seconds. I am just curious
: about why JVM kick off gc that often.
: Can anyone shed some light on it?
: beginning:
: 97.788: [GC [PSYoungGen: 3036448K->643872K(33088

t*******e
发帖数: 684
5

这个说明很棒,很多实用的信息.

【在 i****k 的大作中提到】
: 12g 的heap太大了。不知道你的APP是什么。如果是需要支持很多用户的WEB,正确的方
: 法是考虑用cluster, horizontally scale up。
: 目前的JVM,对12G这么大的HEAP都会出现性能病态。你肯定是在用64位JVM。64位JVM本
: 身目前也普遍比32位JVM慢20 ~ 25%左右。多数厂商建议即使在64位OS上也要用32位
: JVM。
: 如果用32位JVM,在3G左右还是频繁OLD GEN GC,那么你的APP应该是病态的,需要
: PROFILE什么类的对象被频繁分配和GC,是否有大STRING对象被频繁分配( String +
: String 之类的code),是否有大块数据频繁被IO。针对这些情况,考虑用FLYWEIGHT一
: 类的设计模式,用StringBuffer,用cache strategy。下载一个免费试用的工具
: YourKit,解决这类问题很有效。

1 (共1页)
进入Java版参与讨论
相关主题
a garbage collection question菜鸟请教jsp和ejb
Java里面可以暂时禁用Garbage Collection吗?An experiment with JVM Garbage Collection Schemes
Garbage collection 问题jar file question
要准备java面试, 看什么书比较好?Another garbage collection question
Java都在什么时候进行Garbage collection?Re: Out of memory, Java heap space 的问题怎么解决? (转载)
Java/J2EE的面试中,关于garbage collection的问题应该怎么回答?OutofMemoryError: Java Heap Space
Java StringBuilder myth debunked求教有没有好的查memory leak的工具?
java最大用多少内存请教一个javascript的heap的问题。
相关话题的讨论汇总
话题: gc话题: jvm话题: garbage话题: collection话题: seconds