I'm using an ICEFaces application that runs over JBOSS, my currently heapsize is set to
-Xms1024m –Xmx1024m -XX:MaxPermSize=256m
what is your recommendation to adjust memory parameters for JBOSS AS 5 (5.0.1 GA) JVM 6?
I'm using an ICEFaces application that runs over JBOSS, my currently heapsize is set to
-Xms1024m –Xmx1024m -XX:MaxPermSize=256m
what is your recommendation to adjust memory parameters for JBOSS AS 5 (5.0.1 GA) JVM 6?
Heap: Start with 512 MB, set the cap to where you believe your app should never get, and not to make your server start swapping.
Permgen: That's usually stable enough, once the app reads all classes used in the app. If you have tested the app and it works with 256 MB, then leave it so.
According to this article:
AS 5 is known to be greedy when it comes to PermGen. When starting, it often throws
OutOfMemoryException: PermGen Error
.
This can be particularly annoying during development when you are hot deploying frequently an application. In this case, JBoss QA recommends to raise the permgen size, allow classes unloading and permgen sweep:
-XX:PermSize=512m -XX:MaxPermSize=1024 -XX:+UseConcMarkSweepGC -XX:+CMSPermGenSweepingEnabled -XX:+CMSClassUnloadingEnabled
But this is more FYI, I'm not suggesting to apply this configuration blindly (as people wrote in comments, "if it ain't broken, don't fix it").
Regarding your heap size, always keep in mind: the bigger the heap, the longer the major GC. Now, when you say "it was definitely too small", I don't really know what this means (what errors, symptoms, etc). To my knowledge, a 1024m heap is actually pretty big for a webapp and should really be more than enough for most of them. Just beware of the major GC duration.
Your PermGen size can be the default as long as that doesn't cause any problems. If apps start crashing due to PermGen running out you're either being hit by the all too common problems with memory leaks when redeploying, or you're just deploying a lot of stuff with a lot of different libraries. The latter can be fixed by increasing the available space, the former must be fixed on an application by application basis.
Now for the other settings, the answer is very simple: set -Xms to something sensible (i.e. 1024MB) and -Xmx as high as you can. As high as you can in this case meaning "whatever physical memory is still available under typical load with all other applications running". Subtract a couple 100 megs to make room and use that number.
If you're running your server in a development/test environment you might want to set your heap size a bit lower to be able to more easily catch memory leaks.
edit: BTW, this seems more like a question for serverfault?
@wds: It's definitely not a good idea to set the heap maximum as high as possible for two reasons:
This would happen maybe once a week in my application until I:
For developers I think it's fine to increase PermGen, but in production you probably want to use only what is necessary to avoid long GC pauses.