You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Host: YRC1000 running MotoROS2
Client: PC running Ubuntu 22.04
ROS2 version: Humble
Commits: The commit hashes/version used to build MotoROS2 are available here
DDS: FastDDS
I am a contributor to MotoROS2. Our implementation allows the controller and client to be disconnected/reconnected repeatedly. Whenever I disconnect the client pc from the host, the memory is freed and everything is shut down, and then everything is re-initialized upon connecting again. However, I noticed a memory leak, 24 bytes per disconnect/reconnect cycle. I eventually traced it to its source and found the leak.
The memory allocated in these strdup calls is never freed.
I have a branch on our fork of micro-roshere where I added a single line freeing the memory allocated in that strdup, and the memory leak disappeared. There is now no memory lost with a connect/disconnect cycle.
I noticed the problem in Motoman's own fork of micro-ros/rcl, which is somewhat outdated. But looking through the up-to-date upstream repos, the problem is seemingly present in micro-ros/rcl as well as here. Not just in humble, but in newer distributions/rolling as well.
I do not know if the spot that I freed the memory is the proper spot to do so. But if I understand correctly, it has not yet been fixed upstream (here) and the proper spot to free the memory is somewhere in this repo.
The text was updated successfully, but these errors were encountered:
which is somewhat outdated. But looking through the up-to-date upstream repos, the problem is seemingly present in micro-ros/rcl as well as here. Not just in humble, but in newer distributions/rolling as well.
did you confirm the there is a memory leak on ros2/rcl (rolling)?
Host: YRC1000 running MotoROS2
Client: PC running Ubuntu 22.04
ROS2 version: Humble
Commits: The commit hashes/version used to build MotoROS2 are available here
DDS: FastDDS
I am a contributor to MotoROS2. Our implementation allows the controller and client to be disconnected/reconnected repeatedly. Whenever I disconnect the client pc from the host, the memory is freed and everything is shut down, and then everything is re-initialized upon connecting again. However, I noticed a memory leak, 24 bytes per disconnect/reconnect cycle. I eventually traced it to its source and found the leak.
rcl/rcl/src/rcl/init.c
Lines 216 to 223 in 2615b0e
The memory allocated in these
strdup
calls is never freed.I have a branch on our fork of
micro-ros
here where I added a single line freeing the memory allocated in thatstrdup
, and the memory leak disappeared. There is now no memory lost with a connect/disconnect cycle.I noticed the problem in Motoman's own fork of
micro-ros/rcl
, which is somewhat outdated. But looking through the up-to-date upstream repos, the problem is seemingly present inmicro-ros/rcl
as well as here. Not just in humble, but in newer distributions/rolling as well.I do not know if the spot that I freed the memory is the proper spot to do so. But if I understand correctly, it has not yet been fixed upstream (here) and the proper spot to free the memory is somewhere in this repo.
The text was updated successfully, but these errors were encountered: