9.3. Heap Benchmarks¶
The “Heap” section provides information about how much dynamically allocated memory is used by Connext DDS Micro. It should be noted that exact numbers are very difficult to estimate and that the numbers are only for guidance. Please refer to ResourceModule 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.
9.3.1. Heap Usage¶
The following table shows how much memory each resource-limit in the memory model
|Resource-limit||Size in Bytes||Notes|
|max_participants||13712||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||116||Add strlen(topic_name) + 1|
|local_type_allocation||12||Add strlen(type_name) + 1|
|local_reader_allocation||2184||The sample and instance resources must be added.|
|local_writer_allocation||2595||The sample and instance resources must be added.|
|remote_writer_allocation||about 600||This includes the topic_name|
|remote_reader_allocation||about 600||This includes the topic_name|
184.108.40.206. 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
(13) + string.len(type_name) + 1
(117) + string.len(topic_name) + 1
220.127.116.11.3. DDS DataReader¶
(2184) + (rl_ms * 160 ) + (rl_mi * 271) + (rl_mrw * 391) + (rl_mrpw * 87)
18.104.22.168.4. DDS DataWriter¶
(2595) + (rl_ms * 116) + (rl_mi * 79) + (wrl_mrr * 391) + (wrl_mrpr * 87)
(501) + (16 * 24)
(149) + string.len(topic_name) + 1 + (16 * 24)
(173) + strlen(topic_name) + 1 + (16 * 24)
9.3.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 DDS 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:
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)|
9.3.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 DDS 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:
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)|