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

For an application I use JVM Max heap setting when starting it on both a test environment and a production system. When i connect via JMX to monitor the application I see that the max heap size of production app is not the same as test application. I use -Xmx2000m on both and on test environment I get 1,864,171,520 B and on production I get 2,009,726,976 B.

So my questions are -Is this info reliable. The Java versions and the machines are identical (Mac OS X 10.5).

-If this info is reliable then what could be causing this and how can it be changed so both systems behave the same for max heap size setting.

share|improve this question
Is the architecture identical? – Matt Simmons Jan 18 '12 at 14:19
Is the the same JVM engine/version on both servers? – fge Jan 18 '12 at 15:13
Does the application work with data? Is the data the same at both machines? – Tim Jan 18 '12 at 15:33
architechture and jvm are same. The data is not the same. And data in production does cause the application to be killed so it was restarted. Then I noticed that Max heap size for a fresh start application is less than the one which has been running for a while. Atleast this is what JMX tells me. I am still not sure why that is the case, may be I have to look into how heap size is managed by JVM over a lifetime of an application. – geoaxis Jan 19 '12 at 11:30

The JVM will not automatically allocated the -Xmx amount of memory, so very minor environmental differences could cause the two virtual machines to end up with different process sizes (and for 2 GB, 139 MB is and arguably small difference, no ?)

See this post on JVM Memory Usage.

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.