22.2.2 Reader-Side Memory Management when Using Java

When the Java API is used with DataReaders using generated type-plugins, Connext DDS allocates a Java buffer per DataReader; this buffer is used to copy the native serialized data, so that the received DDS samples can be deserialized into the Java objects obtained from the DDS sample pool in Figure 22.3: Adding DDS Samples to DataReader’s Queue .

You can use the DataReader properties in Table 22.2 DDS Sample-Data Memory Management Properties for DataReaders when Using Java API to control memory allocation for the Java buffer used for deserialization:

Table 22.2 DDS Sample-Data Memory Management Properties for DataReaders when Using Java API

Property

Description

dds.data_reader.
history.memory_manager.
java_stream.min_size

Only supported when using the Java API.

Defines the minimum size of the buffer used for the serialized data.

When a DataReader is created, the Java layer will allocate a buffer of this size and associate it with the DataReader.

Default: -1 (UNLIMITED) This is a sentinel to refer to the maximum serialized size of a DDS sample, as returned by the type plugin method get_serialized_sample_max_size().

dds.data_reader.
history.memory_manager.
java_stream.trim_to_size

Only supported when using the Java API.

A Boolean value that controls the growth of the deserialization buffer.

If set to 0 (the default), the buffer will not be re-allocated unless the serialized size of a new DDS sample is greater than the current buffer size.

If set to 1, the buffer will be re-allocated with each new DDS sample in order to just fit the DDS sample serialized size. The new size cannot be smaller than min_size.

© 2020 RTI