Skip to content
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

Make AudioFrame / VideoFrame more gc-friendly #517

Closed
jlaine opened this issue May 5, 2019 · 2 comments
Closed

Make AudioFrame / VideoFrame more gc-friendly #517

jlaine opened this issue May 5, 2019 · 2 comments

Comments

@jlaine
Copy link
Collaborator

jlaine commented May 5, 2019

@Mofef pointed out in #317 (comment) that our VideoFrame contain reference cycles which prevent the garbage collector from reclaiming the frames as soon as they are unused. Let's try and improve this!

Here is a trivial example which currently has a fairly large memory (but stable) memory consumption:

import av
  
with av.open('test.mp4') as container:
    for frame in container.decode(video=0):
        print(frame.pts)

On a 1080p video, RSS stabilizes around 480MB for me.

@jlaine
Copy link
Collaborator Author

jlaine commented May 5, 2019

Applying #516, RSS drops to 85MB.

@jlaine
Copy link
Collaborator Author

jlaine commented May 7, 2019

Fixed in 75036f6

@jlaine jlaine closed this as completed May 7, 2019
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

No branches or pull requests

1 participant