IRONSIDES icon indicating copy to clipboard operation
IRONSIDES copied to clipboard

Memory leak in ROS slam_node due to PIRVS::RunSlam

Open thien94 opened this issue 7 years ago • 3 comments

Hi PerceptIn team,

I am using the Ironsides with Intel NUC i7, SDK 1.2.0 . Right now there is a memory leak problem: whenever I run slam_node the RAM usage on the host (I have tested with Intel NUC i7 and laptop i5) will continuously increase over time and would not stop. This behaviour does not happen when I run stereo_camera_node or depth_camera_node.

I have located the issue and it is due to the function PIRVS::RunSlam in slam_node.cpp: https://github.com/TrifoRobotics/IRONSIDES/blob/5cac1a6f225d2f3dd6451ea2664c927583c2b06c/src/slam_node.cpp#L232

Without calling that function, the RAM usage will remain stable.

Hope to hear from you soon.

thien94 avatar Jul 26 '18 05:07 thien94

Hi there, Our slam algorithm will keep a global map with 3D features. So when the mapper is getting larger, the memory usage will increase. If you memory increase very fast, please test with our SDK application(slam.cpp) first. I know that keep publishing images with slam running will cause memory increase, when running our slam in an old PC. You can temporarily removing CreateImageMsg function and image publishing functions to see the performance. Weikai

wli009 avatar Jul 27 '18 17:07 wli009

Hi, thanks for the reply. We observed the same issue with the slam app from the SDK, meaning that the memory usage will steadily increase over time. For the ros slam_node, removing the CreateImageMsg function didn't help. Also, since our application requires both the slam data and images, that would be undesirable as a solution.

thien94 avatar Jul 29 '18 04:07 thien94

I think that is normal. Memory cost is normally up to hundreds of MB when running our SLAM. As the map gets larger, the memory cost will increase.

wli009 avatar Jul 30 '18 17:07 wli009