3.2. Memory Performance

3.2.1. Heap Benchmarks

The “Heap” section provides information about how much dynamically allocated memory is used by Connext Micro. It should be noted that exact numbers are very difficult to estimate and that the numbers are only for guidance. Please refer to the Resource Module in the Connext Micro C API documentation for a more information on resource limits and memory usage.

On Linux, for each heap allocation using malloc, malloc_usable_size() is called to determine the actual size of each allocation. The numbers include resources used by the RH_SM, WH_SM, and UDP components, but not the resources used by the dynamic discovery component (DPDE) or the static discovery component (DPSE). In addition, please note that the memory does not include memory for the actual user-data. This must be added according to the resource limits. The numbers are for the release libraries.

The size for entities that are controlled by resource limits are provided. In addition, a formula is provided to estimate the amount of memory used by a data reader and data writer as these are typically the ones that consume most of the memory.

3.2.1.1. Heap Usage

../../../../_images/MicroMemoryMap.png

The following table shows how much memory each resource-limit uses in the memory model for the x64Linux4gcc7.3.0 architecture.

Entity

Size (Bytes)

dpde

81232

dpse

38592

DomainParticipantFactory

5112

max_participants

22312

max_components

N/A

local_topic_allocation

259

local_type_allocation

83

local_publisher_allocation

403

local_subscriber_allocation

436

local_reader_allocation

3707

local_writer_allocation (Best Effort DW)

4058

local_writer_allocation (Reliable DW)

3675

matching_writer_reader_pair_allocation

52

remote_participant_allocation

1070

remote_writer_allocation

about 600

remote_reader_allocation

about 600

max_destination_ports

99

max_receive_ports

484

(DataReader) max_instances

400

(DataReader) max_samples

241

(DataReader) max_remote_writers

511

(DataReader) max_routes_per_writer

127

(DataReader) max_samples_per_instance

0

(DataReader) max_remote_writers_per_instance

0

(DataReader) max_samples_per_remote_writer

0

(DataWriter best effort) max_instances

128

(DataWriter best effort) max_samples

167

(DataWriter best effort) max_remote_readers

559

(DataWriter best effort) max_routes_per_reader

127

(DataWriter reliable) max_instances

127

(DataWriter reliable) max_samples

544

(DataWriter reliable) max_remote_readers

558

(DataWriter reliable) max_routes_per_reader

127

(DataWriter) max_samples_per_instance

0

max_locators_per_discovered_participant

83

max_buffer_size

0

max_message_size

0

Notes:

  • max_participants: This is the memory for an empty participant. The memory used by each entity must be added as described for each entity.

  • local_topic_allocation: Add strlen(topic_name) + 1

  • local_type_allocation: Add strlen(type_name) + 1

  • local_reader_allocation: The sample and instance resources must be added.

  • local_writer_allocation: The sample and instance resources must be added.

  • remote_writer_allocation: This includes the topic_name.

  • remote_reader_allocation: This includes the topic_name.

Calculating Memory Usage for DDS Entities

The following short-hands are used in these formulas:

  • rl_ms - resource_limits.max_samples

  • rl_mi - resource_limits.max_instances

  • rl_mrw - datareader_resource_limits.max_remote_writers

  • rl_mrpw - datareader_resource_limits.max_routes_per_writer

  • wrl_mrw - datawriter_resource_limits.max_remote_readers

  • wrl_mrpr - datawriter_resource_limits.max_routes_per_reader

Type
(36) + string.len(type_name) + 1
Topic
(140) + string.len(topic_name) + 1
DDS DataReader
(2285) + (rl_ms * 160 ) + (rl_mi * 271) + (rl_mrw * 391) + (rl_mrpw * 87)
DDS DataWriter
(2727) + (rl_ms * 116) + (rl_mi * 79) + (wrl_mrr * 391) + (wrl_mrpr * 87)
RemoteParticipant
(remote_participant_allocation) + (16 * 24)
RemotePublication
(remote_writer_allocation) + string.len(topic_name) + 1 + (16 * 24)
RemoteSubscription
(remote_reader_allocation) + strlen(topic_name) + 1 + (16 * 24)

3.2.1.2. Dynamic Discovery (DPDE) Heap Usage Information

The DPDE plugin is a DDS application that advertises locally created DDS entities and listens for DDS entities available in the DDS data-space. It is implemented using the DDS APIs supported by Connext Micro.

The DPDE plugin creates the following DDS entities:

  • One DDS Publisher

  • One DDS Subscriber

  • Three DDS Topics

  • Three DDS DataReaders

  • Three DDS DataWriters

The DPDE plugin also registers the following three types:

  • DDS_ParticipantBuiltinTopicData

  • DDS_PublicationBuiltinTopicData

  • DDS_SubscriptionBuiltinTopicData

All heap memory allocated by the DPDE plugin is allocated after the DDS DomainParticipant is created (no additional memory is allocated after the DDS DomainParticipant is enabled).

DPDE Plugin

Release Size(B)

Plugin

66488

3.2.1.3. Static Discovery (DPSE) Heap Usage Information

The DPSE plugin is a DDS application that only advertises locally created DDS DomainParticipants and listens for other DDS DomainParticipants available in the DDS data-space. It is implemented using the DDS APIs supported by Connext Micro.

The DPSE plugin creates the following DDS entities:

  • One DDS Publisher

  • One DDS Subscriber

  • One DDS Topics

  • One DDS DataReader

  • One DDS DataWriter

The DPSE plugin also registers the following type:

  • DDS_ParticipantBuiltinTopicData

All heap memory allocated by the DPSE plugin is allocated after the DDS DomainParticipant is created (no additional memory is allocated after the DDS DomainParticipant is enabled).

DSDE Plugin

Release Size(B)

Plugin

32020