aspose file tools*
The moose likes JBoss/WildFly and the fly likes Too big memory size assigned for JBoss? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "Too big memory size assigned for JBoss?" Watch "Too big memory size assigned for JBoss?" New topic
Author

Too big memory size assigned for JBoss?

Michal Glowacki
Ranch Hand

Joined: Mar 14, 2006
Posts: 114
hi,

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...

Thanks,
Michal
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5779
    
    7

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.

To read more about the various garbage collectors and how to use them you can either look at chapter 14 of JBoss in Action or see these white papers:
Java Garbage Collection Statistical Analysis 101
Java Garbage Collection Performance Analysis 201
at http://www.cmg.org/cgi-bin/search.cgi?q=java+peter+johnson&x=30&y=10

JBoss In Action
Michal Glowacki
Ranch Hand

Joined: Mar 14, 2006
Posts: 114
I am using ParallelGC (-XX:+UseParallelGC -Dsun.rmi.dgc.client.gcInterval=900000 -Dsun.rmi.dgc.server.gcInterval=900000)
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5779
    
    7

Parallel GC still uses the default collector for major collections. ParallelGC applies only to minor collections. Did you read the docs I mentioned?
Michal Glowacki
Ranch Hand

Joined: Mar 14, 2006
Posts: 114
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.

Thanks in advance for your comments,
Michal
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5779
    
    7

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.)
Michal Glowacki
Ranch Hand

Joined: Mar 14, 2006
Posts: 114
Yes, I am using JDK6. I remove the param then. Thanks a lot.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Too big memory size assigned for JBoss?
 
Similar Threads
JVM - Memory Issues
about jboss Console Administration
sessionTimeout?
Performance of JBoss
Websphere or Jboss?