Giter Club home page Giter Club logo

connextdds_memleak's Introduction

connextdds_memleak

Attempts to reproduce a potential memory leak when using rmw_connextdds with ROS 2.

The result was that it wasn't a memory leak, but instead a shmem setting that caused unexpected memory growth that was ultimately bounded.

Running

The quickstart is to set up your environment how ever you want to test it, then run:

python3 ./monitor_pub_echo_mem.py

This will run a pair of processes to test pub/echo with ros2 topic. Meanwhile monitoring the memory usage, plotting it live, and depositing the data into a csv file.

Optionally, you can adjust the publish rate with the --publish-rate option (Hz).

The csv log files start with memory_log- and can be plotted afterwards with:

python3 ./plot_memory_log.py <path/to/memory_log-*.csv>

The first few lines of the csv log file contain details about the run commented with #. Afterwards, the csv takes the form of timestamp, pub memory in MB, echo memory in MB.

Examples of Different Configurations

If you want to change the rmw implementation to rmw_connextdds:

RMW_IMPLEMENTATION=rmw_connextdds python3 ./monitor_pub_echo_mem.py

If you want to use a custom QoS XML:

NDDS_QOS_PROFILES=`pwd`/builtin_keep_last_reliable_large_data.xml \
RMW_IMPLEMENTATION=rmw_connextdds \
python3 ./monitor_pub_echo_mem.py

How to Reproduce the Ramp Curve Example

We've narrowed it down to the shared memory settings, which are needed to get the observed "ramp" shaped curve. Where the memory use climbs quickly but then stabalizes are some memory usage level:

run_1000hz_connext_viper_qos_figure

The environement used is:

  • ROS 2 Rolling
  • Connext 6.0.1 (though it has been observed with 5.3.1 and 6.1+)

And the command used:

RMW_IMPLEMENTATION=rmw_connextdds \
NDDS_QOS_PROFILES=/home/william/connextdds_memleak/viper_ros2_qos_with_tcp.xml \
python3 ./monitor_pub_echo_mem.py --publish-rate 1000

The high publish rate just increases the rate of memory use increase. Lower publish rates still produce the same curve, just over a longer period. With a rate of 1kHz the stable memory usage limit can been reached in a few minutes.

connextdds_memleak's People

Contributors

matthewdeans avatar wjwwood avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.