Re: Question on -Xms/-Xmx and -XX:MaxPermSize in JVM start
parameter
On Sat, 9 May 2009, Arne Vajh?j wrote:
krislioe@gmail.com wrote:
I have question on the JVM start parameter, in ours we have set it
like this :
........-Xms3072M -Xmx3072M -XX:+AggressiveHeap -
XX:MaxPermSize=1024M.........
When we say MaxPermSize = 1024M does it mean that it is taken from
3072M that I set for Xms/Xmx ?
(so that the physical memory that is taken all is 3072M instead of
4096M ?)
Or
Is it really allocated separately, so that I really have to provide
4096M ??
If I read the figure in:
http://java.sun.com/docs/hotspot/gc5.0/gc_tuning_5.html#1.1.Sizing%20the%20Generations|outline
correctly then MaxPermSize is not inclusive in Xmx.
But it is not that explicit in the text, so it would be nice if one of
JVM gurus would comment.
I'm no JVM guru, but i do know that this is correct: there are a number of
separate memory pools in the JVM, whose maximum sizes are set separately.
They include the permanent space (set with -XX:MaxPermSize) and the
general heap (set with -X:mx). However, there are more, besides those two!
I don't know much about them, but i know they exist, because we frequently
observe apps using more space than the total of mx and PermGen. I
speculate that it could be stacks or memory allocated by native code, but
i really don't know.
Personally, i find it incredibly irritating that there isn't a flag to
limit total memory use, which is surely what people actually need. I
couldn't give two hoots about the size of PermGen, but if i have a machine
with 4 GM of RAM that's running two app server stacks in parallel, i
bloody well need to be able to put a hard limit of 2 GB (or whatever) on
each. Yes, i can probably do this with ulimit in the startup script, but
why isn't there just an option for it?
tom
--
These spoiled youths forget that when they are shaven they look like
boiled potatoes. -- Tara Singh