recently I have read an article, where author said that increasing amount of memory for JBoss above 2GB is wrong, as garbage collection takes too long. I have a heavy-duty machine, with 16GB of RAM and I have set JVM arguments to:
-Xms8g -Xmx8g -XX:MaxPermSize=512m -XX:NewRatio=3
Anyone could comment this? I really can't change the value without being sure...
If you have more that 2GB heap, and you are using the default garbage collector, when you hit a major collection that collection could take a very long time to process (10s or second, perhaps even several minutes). Of course, while garbage collection is happening, your application is stopped. Whether this is a problem or not depends entirely on your application. If you application is interactive, such as a web application, such pauses are not very user friendly. In which case you might want to change to using the CMS collector.
Parallel GC still uses the default collector for major collections. ParallelGC applies only to minor collections. Did you read the docs I mentioned?
Joined: Mar 14, 2006
Yes, I have took a look at your articles now. I think I need few days to understand what you wrote there
However, if you could do me a quick advise. Just now I am monitoring my server which is under load with YourKit profiler. I see that there is longer garbage collection every 15 mins (around) which takes 12 seconds! During this gc following values change (from -> to):
Allocated all pools: 7,9GB -> 7,9GB
Used PS Eden Space: 1,7GB -> 580MB
Used PS Survivor Space: 33MB -> 0
Used PS Old Gen: 3,3GB -> 1,5GB
Is it the indication that assigning 8GB for heap space is too much? Of course I know I have to tune the settings more than just reducing only the heap (and I'll do it with your article), however I would like to correct most glowing errors ASAP.
That 12 second pause is for a major collection; you can tell this by the drop in the old gen usage.
You currently have NewRatio set to 3. In that case you will only ever use about 2/3rds of the defined heap (see the 101 paper for a discussion as to how the JVM decided to do a major collection); note that a major gc happened when you were using 5GB of your 8GB heap. You might be better off with a higher NewRatio of 4, 5 or 6, maybe even 8. Are you using JDK 6? If so, don't set a NewRatio; JDK 6 is pretty good at setting an acceptable young gen size based on usage patterns. (This last point is not in those papers because they were written before JDK 6 came out; some of my more recent papers mention it.)
Joined: Mar 14, 2006
Yes, I am using JDK6. I remove the param then. Thanks a lot.