Yaskawa-Global / motoros2

ROS 2 (rcl, rclc & micro-ROS) node for MotoPlus-compatible Yaskawa Motoman robot controllers
95 stars 16 forks source link

Possible memory leak (after dis-, then reconnect of Agent) #35

Open gavanderhoorn opened 1 year ago

gavanderhoorn commented 1 year ago

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:

Initialization complete. Memory available: (962992) bytes. Memory in use: (85584) bytes
Initialization complete. Memory available: (962992) bytes. Memory in use: (85584) bytes
Initialization complete. Memory available: (962552) bytes. Memory in use: (86024) bytes
Initialization complete. Memory available: (962280) bytes. Memory in use: (86296) bytes
Initialization complete. Memory available: (962280) bytes. Memory in use: (86296) bytes
Initialization complete. Memory available: (962280) bytes. Memory in use: (86296) bytes
Initialization complete. Memory available: (962256) bytes. Memory in use: (86320) bytes
Initialization complete. Memory available: (962224) bytes. Memory in use: (86352) bytes

As a table:

# Free Delta In use Delta
0 962992 85584
1 962992 0 85584 0
2 962552 -440 86024 440
3 962280 -272 86296 272
4 962280 0 86296 0
5 962280 0 86296 0
6 962256 -24 86320 24
7 962224 -32 86352 32

No changes to the config file between reboots dis-and-re-connects.

It's unclear what causes this at this point.

gavanderhoorn commented 1 year ago

Summary of earlier findings/comments: