Skip to content

Runaway memory use when consuming video in livekit-rtc #444

@tobowers

Description

@tobowers

Select which package(s) are affected

@livekit/rtc-node

Describe the bug

When consuming video through a video stream, the memory of the process grows unbounded. This happens simply by creating a video stream, whether you consume the VideoFrame or not.

Memory growth was gigabytes per minute with a 1920x1080 video stream (h264)

Reproduction

I tested this down to going into the livekit-rtc code in VideoStream and commenting out anything within OnEvent and the memory consumption still happens.

I also tested using the code as is and consuming every frame as fast as possible. Additionally tested by not consuming any frames at all.

Logs

System Info

Darwin, livekit-rtc: 0.13.8, bun 1.2.5

LiveKit server version

LiveKit cloud

Severity

blocking all usage of LiveKit

Additional Information

No response

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