86.9.1 DDS Sample Memory Management With Durable Subscriptions
The maximum number of DDS samples that will be kept in a PRSTDataWriter queue is determined by the value of <resource_limits><max_samples> in the <writer_qos> used to configure the PRSTDataWriter.
By default, a PRSTDataWriter configured with KEEP_ALL <history><kind> will keep the DDS samples in its cache until they are acknowledged by all the Durable Subscriptions associated with the PRSTDataWriter. After the DDS samples are acknowledged by the Durable Subscriptions, they will be marked as reclaimable but they will not be purged from the PRSTDataWriter’s queue until the DataWriter needs these resources for new DDS samples. This may lead to inefficient resource utilization, especially when <max_samples> is high or UNLIMITED.
The PRSTDataWriter behavior can be changed to purge DDS samples after they have been acknowledged by all the active/matching DataReaders and all the Durable Subscriptions configured for the <persistence_service>. To do so, set the tag <purge_samples_after_acknowledgment> under <persistence_service> to TRUE. Notice that this setting is global to the service and applies to all the PRSTDataWriters created by each <persistence_group>.