Unity-Technologies / ROS-TCP-Endpoint

ROS package used to create an endpoint to accept ROS messages sent from a Unity scene using the ROS TCP Connector scripts
Apache License 2.0
177 stars 118 forks source link

Docker container memory usage increases with time, possible memory leak #124

Closed mikkomcmenamin closed 3 months ago

mikkomcmenamin commented 2 years ago

Describe the bug When the Unity client connects, and starts subscribing to a ROS2 topic, the ROS-TCP-ENDPOINT docker container memory usage starts to go up. Container memory usage increases only if the client is connected and the topic is being subscibed to. Once the client disconnects or there is no more ros2 messages being published, the memory usage stays the same.

Console logs / stack traces No errors or anything out of the ordinary in either ROS-TCP-Endpoint or ROS-TCP-Connector logs.

Expected behavior Container memory usage should not increase with time

Screenshots image (3)

Environment:

Additional context Used msg packages: ros built-in messages, geographic_msgs, unique_identifier_msgs, and a custom message type. Only 1 topic.

iqbaljunaid commented 2 years ago

Did some profiling. Here is a docker profiling log and graph as-ros-to-unity-profiling-log.zip as-ros-to-Unity-profle

hyounesy commented 2 years ago

Thanks for reporting the issue and the detailed information. We created a ticket to investigate the issue [AIRO-1686]

github-actions[bot] commented 2 years ago

This issue has been marked stale because it has been open for 14 days with no activity. Please remove the stale label or comment on this issue, or the issue will be automatically closed in the next 14 days.

mikkomcmenamin commented 2 years ago

Hi! Any updates on this issue?

mikkomcmenamin commented 2 years ago

It seems this issue can be resolved by changing ros2 version from Foxy to Galactic. The problem seems to be in Foxy rclpy serialization.