Xmx vs MaxRAM


That’s quite confusing but Xmx=1g lets my JVM consuming more than 1g of RAM. How so?

Doing some tests here I see that when using Xmx=1g, the JVM is actually using 1.5g! well the explanation is simple:

Xmx only limits the allocated memory on the heap.

So how to limit it??

To specify the total usage you need to use -XX:MaxRAM.

Thanks, CHF for this tip! 

You can use this table as a reference.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s