Another reason to set them equal is to make sure there’s enough physical memory 
available to back the heap. Otherwise, you might get an OOM when the JVM tries 
to commit more memory.

Paul

From: hotspot-gc-use <hotspot-gc-use-boun...@openjdk.java.net> on behalf of Ron 
Reynolds <tequila...@gmail.com>
Date: Wednesday, May 15, 2019 at 1:02 PM
To: George Luiz Bittencourt <geo...@georgeluiz.com>
Cc: GC OpenJDK Hotspot Use List <hotspot-gc-use@openjdk.java.net>
Subject: Re: -Xms and -Xmx

the point of setting start and max heap sizes to the same value is to avoid the 
cost of having to increase the heap size at runtime in those cases where you 
are fairly sure you will need all the heap (i.e., server environments).  the 
disadvantages of setting them is that you might be reserving more heap space 
than your JVM really needs, which isn't a nice thing to do to other processes 
on the same box, especially if memory is tight.  variable memory usage is 
normally a client thing where the load is lower (driven my user actions).

On Wed, May 15, 2019 at 12:47 PM George Luiz Bittencourt 
<geo...@georgeluiz.com<mailto:geo...@georgeluiz.com>> wrote:
Hello,

I see a lot of people in the Java world saying to configure both the -Xms and 
-Xmx parameters as the same value.
However I don't see a reason for that. I come from the .NET world where we do 
not configure theses parameters and it works perfectly.

My question is: what are the disadvantages of not configuring them as the same 
value?
I want to visualize using top or task manager the real use of memory of my Java 
applications.

Thanks,

--
-George
_______________________________________________
hotspot-gc-use mailing list
hotspot-gc-use@openjdk.java.net<mailto:hotspot-gc-use@openjdk.java.net>
https://mail.openjdk.java.net/mailman/listinfo/hotspot-gc-use
_______________________________________________
hotspot-gc-use mailing list
hotspot-gc-use@openjdk.java.net
https://mail.openjdk.java.net/mailman/listinfo/hotspot-gc-use

Reply via email to