Show Table of Contents
20.7.5. Distributed Garbage Collection
In a JGroups cluster, all nodes have to store all messages received for potential retransmission in case of a failure. However, if we store all messages forever, we will run out of memory. So, the distributed garbage collection service in JGroups periodically purges messages that have seen by all nodes 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"
down_thread="false" up_thread="false"
max_bytes="400000"/>
The configurable attributes in the
pbcast.STABLE element are as follows.
- desired_avg_gossip specifies intervals (in milliseconds) of garbage collection runs. Value
0disables this service. - max_bytes specifies the maximum number of bytes received before the cluster triggers a garbage collection run. Value
0disables this service. - stability_delay specifies delay before we send STABILITY msg (give others a change 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.

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.