Skip to content

fix: SG-43388: RV leaks memory because of opened decoders#1316

Open
deltag0 wants to merge 3 commits into
AcademySoftwareFoundation:mainfrom
deltag0:RV-loading-source-leak
Open

fix: SG-43388: RV leaks memory because of opened decoders#1316
deltag0 wants to merge 3 commits into
AcademySoftwareFoundation:mainfrom
deltag0:RV-loading-source-leak

Conversation

@deltag0

@deltag0 deltag0 commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

fix: RV leaks memory because of opened decoders

Summarize your change.

  • Re-enable old context map that manages the number of open threads to decode videos

Describe the reason for the change.

  • Without the context map, the number of open decoder threads keeps increasing as we load more videos.
  • RAM usage would increase a lot even by loading video clips without playing the video at all, and just staying on the first frame.

Describe what you have tested and on which operating system.

Tested on CY 2025 on Rocky Linux 9.8 and Mac

Opened over 1000 clips with 1GB of caching, peaking at 9GB, but staying bounded.
RAM no longer increases when loading clips without playback being on.

Add a list of changes, and note any that might need special attention during the review.

  • After freeing the decoder with avcodec_free_context, nullify the tracked pointer to not point to freed memory
    No regressions by adding the context map

If possible, provide screenshots.

Screenshot from 2026-06-25 08-44-08

deltag0 and others added 2 commits June 23, 2026 16:50
Signed-off-by: deltag0 <victor.terme@autodesk.com>
Signed-off-by: deltag0 <ioan.1931@gmail.com>
@deltag0 deltag0 changed the title fix: update context map fix: SG-43388: RV leaks memory because of opened decoders Jun 25, 2026
@linux-foundation-easycla

linux-foundation-easycla Bot commented Jun 25, 2026

Copy link
Copy Markdown

CLA Signed
The committers listed above are authorized under a signed CLA.

@deltag0 deltag0 force-pushed the RV-loading-source-leak branch 2 times, most recently from 686e739 to b92c079 Compare June 25, 2026 15:33
@deltag0 deltag0 marked this pull request as ready for review June 25, 2026 15:47
Signed-off-by: deltag0 <victor.terme@autodesk.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant