Skip to content

Killed by OOM after couple of days recording rtsp to hdd #4674

@orlovsn

Description

@orlovsn

Which version are you using?

1.12.3

Which operating system are you using?

Linux amd64 standard

Describe how to replicate the issue

MediaMTX is started as systemd service (via simple .sh only starting binary), config file is default without any paths and API enabled
10 paths are added via api with RTSP over TCP enabled
2 paths are completely dead (not connected to network)
2 paths are not sending any data (mediamtx reports paths are ready but received data is not growing)
for all paths storing to hdd is enabled recordFormat = "fmp4", recordPartDuration = "1s", recordSegmentDuration = "10s", records are not deleted by mediamtx (recordDeleteAfter = "0s") but deleted by another software by timer

Once a second mediamtx is polled via api with /v3/paths/list?itemsPerPage=100 request

First time everything is ok and ram usage is low, but after couple of days mediamtx is suddenly killed with OOM

Tasks state (memory values in pages): 
[  pid  ]   uid  tgid total_vm      rss rss_anon rss_file rss_shmem pgtables_bytes swapents oom_score_adj name  
[  21754]     0 21754  6784615  3308362  3308330       32         0 30695424   498464             0 mediamtx
Out of memory: Killed process 21754 (mediamtx) total-vm:27138460kB, anon-rss:13233320kB, file-rss:128kB, shmem-rss:0kB, UID:0 pgtables:299>

Logs shows nothing in mediamtx ouput (just complains about 2 not connected publishers)
No one is reading streams from mediamtx when ram leak happens

How can I get better memory usage profile for mediamtx to understand what is the reason of OOM?

Server logs

No response

Network dump

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions