-
Notifications
You must be signed in to change notification settings - Fork 164
Description
Houston, we have another problem.
There is a memory leak when subscribing to /videofile/image_raw topic. Valgrind sees the memory as always reachable (so technically speaking it's not a true leak), but the process ends up using several gigs of memory. When one stops image_view, memory is released correctly.
If you want to take a look at it, you can clone this branch:
I found an excellent piece of code by @BloodAxe here: https://computer-vision-talks.com/hacking-opencv-for-fun-and-profit/
and now I can even see precise numbers. I'll try to understand why it happens, cv_bridge::CvImage::toImageMsg() does a deep copy, so I actually see no reason for this to happen.
http://docs.ros.org/kinetic/api/cv_bridge/html/c++/cv__bridge_8cpp_source.html
I'll try to look into this further...