Bringing together the Apache Cassandra experts from the community and DataStax.

Want to learn? Have a question? Want to share your expertise? You are in the right place!

Not sure where to begin? Getting Started

 

question

dmngaya avatar image
dmngaya asked ·

Why do you recommend both -Xms and -Xmx flags be the same size ?

Why do you recommand both -Xms and -Xmx flags in the same size ? is it recommendation for dse 6.8 ?

cassandratuning
10 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

1 Answer

Erick Ramirez avatar image
Erick Ramirez answered ·

@dmngaya There are 2 benefits for explicitly setting the minimum heap size (-Xms) to be the same as the max size (-Xmx):

  1. Setting the same value prevents stop-the-world GC pauses when the heap gets resized.
  2. Setting the minimum size pre-allocates the required RAM on startup and locks the heap in memory reducing the chances of the JVM getting swapped out.

Cheers!

Share
10 |1000 characters needed characters left characters exceeded

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.