Skip to content

Make AudioFrame / VideoFrame more gc-friendly #517

Closed

Description

@jlaine

@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.

Activity

  1. jlaine commented on May 5, 2019

    @jlaine
    MemberAuthor

    Applying #516, RSS drops to 85MB.

  2. jlaine commented on May 7, 2019

    @jlaine
    MemberAuthor

    Fixed in 75036f6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions