-
Notifications
You must be signed in to change notification settings - Fork 127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Potential memory leak when creating Unity subscriber #144
Comments
Hi, sorry for the delay in responding to this issue. I ran your sample code (after modifying it to actually publish an image) but I haven't been able to reproduce the memory leak. Which is very mysterious, since you seem to have reproduced it in many separate environments. Also, to unblock you for now, I suggest you try the Roscpp branch of ROS-TCP-Endpoint. This is a rewrite of the endpoint in C++, and should have lower CPU and memory consumption. It's currently in beta, not fully tested but bug reports are welcome. |
It will take some time to port out a section of code that I can publish here since it is behind a private research project. Furthermore, may I inquire how you plan to running the sample? I asked because my current setup requires a number of setup steps to generate my current setup on Windows and/or Ubuntu OS. Docker can be extremely helpful in normalizing the development environment here. In the meantime, can you clarify what you meant by "modifying it to publish an image"? The problem occurs when Unity subscribe to a ROS topic that is publishing a |
Hello, I can confirm this issue. In fact, I ran into the exact same issue yesterday on an Ubuntu 20.04 environment while trying to send image data from gazebo -> Ros TCP-Endpoint -> Unity. I Tested this running the TCP-Endpoint and the application on the same machine, as well as running the application on a Occulus VR-Headset and the TCP-Endpoint on the aformentioned Ubuntu enviroment. Given how fast the memory leak occurs for me once connected (about 32GB in less than 3min) I assume at this point |
Describe the bug
When registering subscriber from Unity to a ROS message e.g.
memory usage of
default_server_endpoint.py
rises rapidly and will not release until ROS is shutdown viaCTRL-C
.To Reproduce
Steps to reproduce the behavior:
default_server_endpoint.py
via roslaunch i.eroslaunch ros_tcp_endpoint endpoint.launch
along with other topics you want Unity to be able to access, my case were images from a Gazebo simulated camera.Console logs / stack traces
Unity console log did not report anything. I have attached ROS logs as additional information.
ROS-log-ff137296-c503-11ec-bb7b-e4b97af38577.zip
Expected behavior
RAM usage should go up since there is active communication between the two, assuming message encoding/decoding matters, but not at that rate.
Screenshots
Environment (please complete the following information, where applicable):
Original issue first noticed while using Docker on WSL on Windows 11. I assumed it has something to do with WSL so I ported my code to a different machine running Ubuntu 20.04, same result.
Additional context
As long as there is nothing published on the topic, this issue doesn't happen i.e. subscribing to an empty
/joint_states
topic does not increase RAM usage.I remember distinctively having to declare publisher/subscriber way back when but can't seem to find the reference, I'll add once I found it.Found the old example in Unity-Robotics-Hub v0.5.0. It seems the newer syntax has made this obsolete.It might be related to #139, #124, and #19. As far as I can tell there is no noticable differences between swapping out any version of either ROS-TCP-Endpoint or ROS-TCP-Connector.
The text was updated successfully, but these errors were encountered: