Open gavanderhoorn opened 1 year ago
Summary of earlier findings/comments:
we could be handling message/service/action memory incorrectly. The micro-ROS documentation specifically states:
If the
init
function is called twice for the same message without callingfini
in between previously allocated memory will be leaked
There's *_create()
/*_destroy()
and micro_ros_utilities_create_message_memory(..)
/micro_ros_utilities_destroy_message_memory(..)
in micro_ros_utils
. Calling *_create()
and then *_init()
on sequence fields might also leak memory.
our libmicroros
might be missing some fixes upstream already has: we're using https://github.com/micro-ROS/rmw_microxrcedds/commit/a2a74846971697e4afc8a70b59c9a8352d74195b in our Humble builds, but according to the commit history, a couple commits later https://github.com/micro-ROS/rmw_microxrcedds/pull/280 gets merged (as https://github.com/micro-ROS/rmw_microxrcedds/commit/6df0003fe6d36fbcab77b5a663acba738e265890). From the description, it sounds like this could have something to do with the memory leak we're seeing.
As mentioned in the Known issues & limitations section of the README (here), MotoROS2 currently appears to suffer from a small memory leak.
Testing shows the following values for used and free memory after several consecutive connect and disconnect cycles with a Galactic micro-ROS Agent:
As a table:
No changes to the config file between
rebootsdis-and-re-connects.It's unclear what causes this at this point.