22.1.2 Memory Management with Batching

When the write() operation is called on a DataWriter for which batching is enabled (see 7.5.2 BATCH QosPolicy (DDS Extension)), the DataWriter serializes (marshals) the input DDS sample into the current batch buffer (see Figure 22.2: DataWriter Actions when Batching is Enabled ). When the batch is flushed, it is stored in the DataWriter’s queue along with its DDS samples. The DataWriter queue can be sized based on:

Figure 22.2: DataWriter Actions when Batching is Enabled

When batching is enabled, the memory associated with the batch buffers always comes from a pre-allocated pool. The size of the buffers is determined by the QoS values max_samples and max_data_bytes (both set in the 7.5.2 BATCH QosPolicy (DDS Extension)) as follows:

Notice that for variable-size DDS samples (for example, DDS samples containing sequences) it is good practice to size the buffer based on max_data_bytes, since this leads to more efficient memory usage.

Note: The value of the property dds.data_writer.history.memory_manager.fast_pool.pool_buffer_max_size is ignored by DataWriters with batching enabled.

© 2020 RTI