[ros-users] [Discourse.ros.org] [Next Generation ROS] Fast-RTPS Memory Usage - Please Help
ros.discourse at gmail.com
Fri Apr 28 18:05:49 UTC 2017
Thank you for bringing this up as a point of clarification. I am aware of the difference between virtual memory size and resident memory size. I have attached a screenshot below showing how the virtual memory becomes resident when an application uses the memory and not immediately when malloc is called.
<img src="/uploads/ros/original/1X/62d3f1bb9a9da5ae8c66244c3b983632f49a4599.png" width="586" height="500">
The issue in my case is that I do not have any way to provide swap space to the OS on my embedded target. Initially everything works functionally since the resident size of all my processes is less than the physical memory size (256 megs). After adding publishers and subscribers for all the necessary topics required the resident size exceeds the physical RAM size and Linux randomly kills a process as described in the following link:
The only way I can ensure that this will not happen in the released software is to enforce that the virtual memory size never exceeds the physical memory available.
My embedded target is running on an SD card and I do not think it is a good idea to add a swap partition due to the wear that occurs on this type of media over numerous write cycles. If I am wrong and it is acceptable to use an SD card partition as swap space then that is very good news for me. Do you know if this is acceptable?
I created this topic in an effort to confirm that the behavior I see on my system is expected and to ask if there is any way to configure Fast-RTPS to allocate significantly less memory. Can you please provide confirmation that the behavior I see is expected? Are you aware of any configuration to reduce the memory allocation?
For a point of reference I have an evaluation copy of a commercial DDS middleware and the VSZ for a simple 'hello world' application is only 4 megabytes. This is a big difference from 300 megs.
Thank you again for taking the time to respond to my post.
[Visit Topic](https://discourse.ros.org/t/fast-rtps-memory-usage-please-help/1739/8) or reply to this email to respond.
More information about the ros-users