Open mqt0029 opened 2 years ago
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. Could you share a more complete sample?
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 sensor_msgs/Image.msg
message, not publishing images from Unity. I believe there is some confusion here. If possible, please also provide your code sample here.
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. Moreover, it does happen only once the unity applications subscribes to the topic and not prior.
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 it has something to do with the data field in ImageMsg not being released correctly on the server. (Im sending about 60-70 fps in 720p)
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.public class ROSManager : MonoBehaviour { public ROSConnection ROS; public Camera HeadMountDisplay;
}