7.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 0
disables this service.
max_bytes specifies the maximum number of bytes received before the cluster triggers a garbage collection run. Value 0
disables 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.
Set the max_bytes
attribute when you have a high traffic cluster.