Skip to content

Memory & CPU leak #4678

@spetrenko

Description

@spetrenko

Which version are you using?

1.12.3

Which operating system are you using?

Linux arm7 standard

Which hardware are you using?

Raspberry Pi 4 Model B 4Gb

Describe how to replicate the issue

  1. Start the server.
  2. Register 6 paths: cam1, cam2, cam3, ... cam6.
  3. Assign several hooks to these paths.
  4. Publish a 20-second video to each path in a loop, with a 10-second interval:
    ffmpeg -re -stream_loop 0 -t 20 -i video.mp4 -c copy -f rtsp -rtsp_transport tcp rtsp://localhost:8554/cam1
  5. Access it through the device, which internally uses GStreamer (RTSP), whenever MediaMTX reports that it is ready.

Expected results

  1. MediaMTX consumes resources moderately.

Actual results

  1. MediaMTX initially consumes a small amount of CPU and memory, but the usage increases over time.
  2. After 40000 sessions the CPU consumption is 270% and the memory consumption is 42%.
  3. Stopping publishing & accessing the server doesn't help.

Temporary fix

Restart MediaMTX

Server logs

Logs for the last hour: mediamtx.log
CPU/Memory consumption: top.log

Network dump

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions