Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm looking at my tomcat using jconsole and I'm trying to understand why the heap size varies between 0.4GB and 1GB.

I thought I told it to start at ~1GB and use no more than ~6GB.

Can anyone explain what is going on.

My commandline has these memory and GC options: java -XX:NewSize=700m -XX:MaxNewSize=700m -Xms1202m -Xmx6014m -XX:MaxPermSize=256m -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:+CMSParallelRemarkEnabled -XX:SurvivorRatio=20 -XX:ParallelGCThreads=4

jconsole memory view

share|improve this question
-Xmsn Specify the initial size, in bytes, of the memory allocation pool

You've told it to start at 1GB.

-Xmxn Specify the maximum size, in bytes, of the memory allocation pool.

You've told it to use at most 6GB.

I don't see any contradiction between what you see, and the behaviour your screenshot describes. -XX:MaxNewSize will force the JVM to start with 700Mo. However, I don't find much doc about this option around the interwebs, so I can't be sure.

Then, your application runs, objects are allocated, and sometimes, the garbage collector fo its work, freeing memory. You just don't reach the limit value you specified at the beginning (certainly because your application does not need it currently). The minimum memory you need is about 370Mo.

Thre is not any problem nor with your configuration (except maybe this -XX:NewMemorySize that I can't understand) neither with the behaviour of your application.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.