Illustration Image

Cassandra.Link

The best knowledge base on Apache Cassandra®

Helping platform leaders, architects, engineers, and operators build scalable real time data platforms.

7/21/2021

Reading time:N/A min

Configuring the garbage collector

by John Doe

Select and configure a garbage collector (GC) to remove data from memory that is no longer in use.Garbage collection is performed by a Java process, garbage collection, which removes data that is no longer needed from memory. For the best performance, use either the Garbage-First (G1) or Continuous Mark Sweep (CMS) collector. By default, DataStax Enterprise (DSE) uses the Garbage-First (G1) collector.The primary differences between the collector options are:G1 divides the heap into multiple regions, where the number of regions depends primarily on the heap size and heap region size. The G1 collector dynamically assigns the regions to old generation or new generation based on the running workload, prioritizing garbage collection in areas of the heap that will yield the largest free space when collected. Additionally, G1 makes tradeoffs at runtime optimizing for a pause target (which is configurable using -XX:MaxGCPauseMillis) to provide predictable performance. CMS divides the heap into new generation (eden + survivor spaces), old generation, and permanent generation, and relies on many heuristics and configurable settings to optimize for performance.

Illustration Image

Select and configure a garbage collector (GC) to remove data from memory that is no longer in use.

Garbage collection is performed by a Java process, garbage collection, which removes data that is no longer needed from memory. For the best performance, use either the Garbage-First (G1) or Continuous Mark Sweep (CMS) collector. By default, DataStax Enterprise (DSE) uses the Garbage-First (G1) collector.

The primary differences between the collector options are:
  • G1 divides the heap into multiple regions, where the number of regions depends primarily on the heap size and heap region size. The G1 collector dynamically assigns the regions to old generation or new generation based on the running workload, prioritizing garbage collection in areas of the heap that will yield the largest free space when collected. Additionally, G1 makes tradeoffs at runtime optimizing for a pause target (which is configurable using -XX:MaxGCPauseMillis) to provide predictable performance.
  • CMS divides the heap into new generation (eden + survivor spaces), old generation, and permanent generation, and relies on many heuristics and configurable settings to optimize for performance.

Related Articles

spring
rest
api

GitHub - DataStax-Examples/spring-data-starter: ⚡️ A sample Spring Data Cassandra REST API

John Doe

2/14/2024

Checkout Planet Cassandra

Claim Your Free Planet Cassandra Contributor T-shirt!

Make your contribution and score a FREE Planet Cassandra Contributor T-Shirt! 
We value our incredible Cassandra community, and we want to express our gratitude by sending an exclusive Planet Cassandra Contributor T-Shirt you can wear with pride.

Join Our Newsletter!

Sign up below to receive email updates and see what's going on with our company

Explore Related Topics

AllKafkaSparkScyllaSStableKubernetesApiGithubGraphQl

Explore Further

garbage.collection