Using the Continuous Mark Sweep (CMS) garbage collector

For some deployments that have small heap sizes, Continuous Mark Sweep (CMS) performs better than Garbage-First (G1) garbage collector (GC). CMS requires manual tuning which is time consuming, requires expertise, and can result in poor performance when not done scientifically or if a workload changes.

Using CMS has the following disadvantages:

  • Manual tuning and testing that requires time and expertise.

  • Only supports heap sizes up to 14 gigabytes (GB). Allocating more memory to heap can result in diminishing performance as the garbage collection facility increases the amount of database metadata in heap memory.

For help configuring CMS, contact the DataStax Services team.

CMS guidelines

Use the following basic recommendations when configuring CMS:

  • Only use CMS in fixed workload environments, that is the cluster performs the same processes all the time.

  • In environment that require the lowest latency possible.

    G1 incurs some latency due to profiling.

  • Configure heap size:

    • For systems with more than 24 GB of RAM, configure a 14 GB heap and the settings from CASSANDRA-8150.

    • For systems with less than 24 GB of RAM, configure an 8 GB heap and use the default settings.

    • For systems that cannot support 8 GB heap (which are not usually fit for production workloads) use the default settings. This allocates ¼ of the available RAM to the heap.

Procedure

  1. Open jvm8-server.options or jvm11-server.options depending upon the JDK.

  2. Comment out all lines in the # G1 Settings section.

  3. Uncomment all the # CMS Settings section.

  4. Restart the database.

Was this helpful?

Give Feedback

How can we improve the documentation?

© 2024 DataStax | Privacy policy | Terms of use

Apache, Apache Cassandra, Cassandra, Apache Tomcat, Tomcat, Apache Lucene, Apache Solr, Apache Hadoop, Hadoop, Apache Pulsar, Pulsar, Apache Spark, Spark, Apache TinkerPop, TinkerPop, Apache Kafka and Kafka are either registered trademarks or trademarks of the Apache Software Foundation or its subsidiaries in Canada, the United States and/or other countries. Kubernetes is the registered trademark of the Linux Foundation.

General Inquiries: +1 (650) 389-6000, info@datastax.com