As a result of the many refactorizations and improvements micro-ROS went through lately (see e.g. here and here), the whole stack comes now a whole different -significantly smaller!- memory footprint.
More concretely, the implementation of shared memory pools for entities to handle the RMW static memory, as compared to the previous paradigm, based on a per entity allocation of pools, is what allows those entities in need to receive data (subscribers, clients, and servers) to save quite a lot of memory.
To grasp an idea of the order of magnitude of the memory saving, it’s useful to compare the new set of results obtained by performing the same measurements we performed back in October, and check the consumption of the most critical cases.
Find the whole updated article here and below three comparisons of representative results:
- The first plot shows the comparison between the total memory used by a variable number of subscribers ranging from 1 to 15 in the old (left column) and new (right column) configurations in both Reliable (first row) and Best-Effort (second row) modes, for a variable size of topics. The communication with the Agent is done over UDP WiFi transport, the MTU is 512 B, and the number of pools (RMW history) is 4 for each entity in the old configuration, and 8 shared between all entities in the new configuration.
- The second plot shows the comparison between the stack, static, and dynamic memories used by a variable number of subscribers ranging from 1 to 15 in the old (left column) and new (right column) configurations in both Reliable (first row) and Best-Effort (second row) modes, for a topic size of 1 B. The communication with the Agent is done over UDP WiFi transport, the MTU is 512 B, and the number of pools (RMW history) is 4 for each entity in the old configuration, and 8 shared between all entities in the new configuration.
- The third and final plot shows instead the comparison between the stack, static, dynamic, and total memories used by either servers (first row) or clients (second row), in a variable number ranging from 1 to 10, in the old (left column) and new (right column) configurations, and for a topic size of 1 B. The communication with the Agent is done over UDP WiFi transport, the MTU is 512 B, and the number of pools (RMW history) is 4 for each entity in the old configuration, and 8 shared between all entities in the new configuration.