28.4. Distributed Garbage Collection (STABLE)


In a JGroups cluster, all nodes must store all messages received for potential re-transmission in case of a failure. However, if we store all messages forever, we will run out of memory. The distributed garbage collection service periodically purges messages that have been seen by all nodes, removing them from the memory in each node. The distributed garbage collection service is configured in the pbcast.STABLE sub-element under the JGroups config element. Here is an example configuration.
<pbcast.STABLE stability_delay="1000"
    desired_avg_gossip="5000" 
    max_bytes="400000"/>
Copy to Clipboard Toggle word wrap
The configurable attributes in the pbcast.STABLE element are as follows.
  • desired_avg_gossip specifies intervals (in milliseconds) of garbage collection runs. Set this to 0 to disable interval-based garbage collection.
  • max_bytes specifies the maximum number of bytes received before the cluster triggers a garbage collection run. Set to 0 to disable garbage collection based on the bytes received.
  • stability_delay specifies the maximum time period (in milliseconds) of a random delay introduced before a node sends its STABILITY message at the end of a garbage collection run. The delay gives other nodes concurrently running a STABLE task a chance to send first. If used together with max_bytes, this attribute should be set to a small number.

Note

Set the max_bytes attribute when you have a high traffic cluster.
Back to top
Red Hat logoGithubredditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust. Explore our recent updates.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

Theme

© 2025 Red Hat