-
Notifications
You must be signed in to change notification settings - Fork 599
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
Memory leak - ros2 humble #262
Comments
@firesurfer thanks for reporting. I'll dig into this over the weekend when I have some time 👍🏼 |
@firesurfer I've addressed the major memory leak issues with #264 (or at least a lot of them 😅 ) There are still a few smaller ones left, but I've run out of time today and need to work on some other things this weekend. Hopefully those fixes are "good enough" for you for now - I'll leave this issue open even after #264 is merged to address the rest of the memory issues later on. |
@firesurfer I believe I've addressed the last memory leak related to this drivers code in #268. There are still 3 memory leaks reported by asan but those are from lower-level ROS 2 packages I believe and not something I can address here in this repo. I've added a Maybe down the road I can add a CI job that uses this option to auto-detect memory leaks in PRs |
@flynneva I just tested #268 I ran valgrind with leak-check=yes, perhaps the output can help you.
|
@firesurfer ah you are right! I only tested without subscribing. Let me try again with subscribing and see what else I can address 👍 |
@firesurfer well I cant seem to get valgrind to work for me to show the same exact memory leaks as you, but I think from your output I'm able to fix the leaks (fingers crossed). I just pushed one more commit to #268 so give it a go and let me know what you get. Could you share with me how you run valgrind? I've tried the following but I dont see the same memory leaks as you:
|
@firesurfer oh nevermind 😓 I was using |
@firesurfer I was able to track down most of the issues in the |
@firesurfer actually wasn't able to solve this just yet. Give me a few days and ill track it dow! |
@flynneva hope you are doing fine! Did you manage to dig further into the issue by now ? |
Relates to ros-drivers#262 Signed-off-by: Evan Flynn <evanflynn.msu@gmail.com>
@firesurfer still working on it a bit and plan to do more work over the weekend. I'll keep you posted 👍 |
@firesurfer small update here: I've narrowed the major leakages down to the Sorry this has taken so long...I had a friends wedding last week and things have been pretty busy for me the last few weeks 😅 |
@flynneva No worries. Thanks for maintaining this package! I just took a quick look myself into the code and the FFmpeg documentation. So if I understand the docs correctly (https://ffmpeg.org/doxygen/2.7/group__lavc__packet.html#ga7ca877e1f0ded89a27199b65e9a077dc) One should only pass a data pointer which has been allocated with av_malloc. Which isn't the case here if I am right. See also this stackoverflow question: |
@firesurfer I think I got it: bd6bb91 now the only leaks that are left are outside of this package it looks like, and they dont grow over time - which is good |
@flynneva Sounds great. I hope I find some time this week to test it! |
@firesurfer just an fyi the update is now on the main |
@flynneva Just tested the latest ros-iron release and it seems to fix the issue! |
@firesurfer awesome thanks for confirming! I'll go ahead and close this issue then 👍 |
Issue
usb_cam node allocates memory over time without freeing it until the systems hangs and the oom kills it.
System
Ubuntu 22.04
ROS2 Humble (binary install)
usb_cam: 0.6.0
v4l2-ctl -D
Camera yaml:
Further info
Camera image is displayed in rviz
Let me know if you need futher information
The text was updated successfully, but these errors were encountered: