From george at georgeluiz.com Wed May 15 19:47:10 2019 From: george at georgeluiz.com (George Luiz Bittencourt) Date: Wed, 15 May 2019 16:47:10 -0300 Subject: -Xms and -Xmx Message-ID: 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 -------------- next part -------------- An HTML attachment was scrubbed... URL: From tequilaron at gmail.com Wed May 15 20:01:09 2019 From: tequilaron at gmail.com (Ron Reynolds) Date: Wed, 15 May 2019 13:01:09 -0700 Subject: -Xms and -Xmx In-Reply-To: References: Message-ID: 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 < george at 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 at openjdk.java.net > https://mail.openjdk.java.net/mailman/listinfo/hotspot-gc-use > -------------- next part -------------- An HTML attachment was scrubbed... URL: From hohensee at amazon.com Wed May 15 20:23:17 2019 From: hohensee at amazon.com (Hohensee, Paul) Date: Wed, 15 May 2019 20:23:17 +0000 Subject: -Xms and -Xmx In-Reply-To: References: Message-ID: <42F7BF3A-A0F7-476E-8C13-54E4B9CC1BE6@amazon.com> 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 on behalf of Ron Reynolds Date: Wednesday, May 15, 2019 at 1:02 PM To: George Luiz Bittencourt Cc: GC OpenJDK Hotspot Use List 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 > 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 at openjdk.java.net https://mail.openjdk.java.net/mailman/listinfo/hotspot-gc-use -------------- next part -------------- An HTML attachment was scrubbed... URL: