Fast-RTPS Memory Usage - Please Help

Yeah, I think the VSZ is not out of the normal. By comparison, my dockerd and gnome-terminal instances in my Linux VM have over 600Mb each in VSZ. I have no doubt that this might be contributing to your OOM killer issues, but it doesn’t seem to be not unique to talker (so it’s probably not a bug). In fact I think the vast majority of that VSZ is shared amongst all of them.

Not that ROS 1 is the standard-bearer, but out of curiosity I had a look at the talker from roscpp_tutorials:

% ps aux | grep talker
william  22046  0.7  0.2 397428 11896 pts/4    Sl+  13:47   0:00 /opt/ros/kinetic/lib/roscpp_tutorials/talker

And it is quite similar with ~397 Mb of VSZ and ~12 Mb of RSS.

That being said, I think Fast-RTPS is mostly designed for “typical” desktop machines with at least a few Gb of memory. There might be simple things we can do to reduce the memory pressure these programs put on the system, but after reading around on the internet, looking at pmap and a cursory look at the output of massif, I don’t see any low hanging fruit.

I still haven’t tried Connext or OpenSplice yet, but they might perform better in your usecase until we can improve Fast-RTPS for this case. That’s part of the idea behind the middleware abstraction is that we can use different implementations with different intrinsic qualities where applicable.

We can almost certainly fine tune the existing software to use less memory, but we just haven’t gotten to that level refinement yet. If anyone has any recommendations (for the ROS 2 code or Fast-RTPS), we’re happy to try them out to improve this.