-
-
Notifications
You must be signed in to change notification settings - Fork 306
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 leaks in HeifContext::encode_image_as_hevc? #960
Comments
Appears to be an issue with x265. |
You can see a basic explanation of why x265 is showing this here: https://x265.readthedocs.io/en/3.1.1/api.html#cleanup It's a perennial bug report with everything that uses x265. libheif doesn't call x265_cleanup(), but that's because the purpose is literally just to appease overly aggressive leak detectors. x265 will re-use the same tiny allocation every time it's re-initialized, and let the OS clean it up with program termination. FFmpeg and most other libraries and tools don't bother to call it either. Not convinced it's the world's greatest design, but it is what it is, and it's only a few KB in most cases. |
@silverbacknet Thanks for mentioning |
Thanks a lot! |
Please let this open until I've looked into |
I think we really do have a leak here. There are two parts - the "definitely lost" and the "possible lost" / "still reachable". Checking with
Adding an
gets to:
So now for the definitely lost part. After staring at x265 source code for an afternoon, I think its a problem in x265. The problem occurs with the x265 command line tool too.
It allocates |
Resolved in #1061 |
@farindk Hi, There maybe a memory leak
x265-3.4
libheif-1.16.2
libvips-8.14.4
Ubuntu 22.04
Steps:
Test case:
IMG_0512.HEIC.zip
thumbnail_heic.c
Result: mem_leak.log
The text was updated successfully, but these errors were encountered: