frigate: [Support]: Possible memory leak

Describe the problem you are having

I have a 5 camera setup. Frigate is running in Docker in an Ubuntu 22.04 container running on Proxmox 7.2-4.

I have to manually restart the container every few days / possible memory leak - see Proxmox memory usage…

image

Version

0.10.1-83481af

Frigate config file

mqtt:
  <configured correctly>

database:
  path: /media/frigate/frigate.db

cameras:
  Reolink-RLC511W-1: 
    ffmpeg:
      inputs:
        - path: <correct rtsp://>
          roles:
            - detect
            - rtmp
        #            - clips
        - path: <correct rtsp://>
          roles:
            - record
    #    width: 640
    #    height: 480
    #    fps: 7
    objects:
      track:
        - person
        - dog
        - cat
    motion:
      mask:
        - 0,0,1280,0,1280,359,0,340
        - 953,625,1280,616,1280,720,0,720,0,343,105,380,113,514,251,543,413,584

  Reolink-RLC511W-2: 
    ffmpeg:
      inputs:
        - path: <correct rtsp://>
          roles:
            - detect
            - rtmp
        #            - clips
        - path: rtsp://admin:Reolink1@10.0.1.213:554/h264Preview_01_main
          roles:
            - record
    #    width: 640
    #    height: 480
    #    fps: 7
    objects:
      track:
        - person
        - dog
        - bicycle
        - cat
    motion:
      mask:
        - 0,0,904,0,1280,0,1280,158,685,143,603,141,56,720,0,720

  Reolink-RLC410W-1: 
    ffmpeg:
      inputs:
        - path: <correct rtsp://>
          roles:
            - detect
            - rtmp
        #            - clips
        - path: <correct rtsp://>
          roles:
            - record
    #    width: 640
    #    height: 480
    #    fps: 7
    objects:
      track:
        - person
        - dog
        - bicycle
        - cat
  #    motion:
  #      mask:
  #        - 314,0,0,0,0,720,316,720
  #        - 1280,720,1280,503,635,720

  Enterance:
    ffmpeg:
      inputs:
        - path: <correct rtsp://>
          roles:
            - detect
            - rtmp
        - path: <correct rtsp://>
          roles:
            - record
    objects:
      track:
        - person
        - dog
        - bicycle
        - cat

  Intercom: # intercom
    ffmpeg:
      inputs:
        - path: <correct rtsp://>
          roles:
            - detect
            - rtmp
            - record
    objects:
      track:
        - person
        - dog
        - bicycle
        - cat

record:
  enabled: True
  events:
    retain:
      default: 5
    pre_capture: 5
    post_capture: 25

detectors:
  cpu1:
    type: cpu
    num_threads: 4

snapshots:
  enabled: True
  timestamp: True
  retain:
    default: 5

rtmp:
  enabled: false

Relevant log output

[2022-06-03 08:49:00] watchdog.Reolink-RLC410W-1     INFO    : Terminating the existing ffmpeg process...
[2022-06-03 08:49:00] watchdog.Reolink-RLC410W-1     INFO    : Waiting for ffmpeg to exit gracefully...
[2022-06-03 08:49:10] ffmpeg.Reolink-RLC410W-1.record ERROR   : [rtsp @ 0x55a8af644980] method DESCRIBE failed: 401 Unauthorized
[2022-06-03 08:49:10] ffmpeg.Reolink-RLC410W-1.record ERROR   : rtsp://<correct rsp scream>: Server returned 401 Unauthorized (authorization failed)
[2022-06-03 08:49:10] watchdog.Reolink-RLC410W-1     INFO    : Terminating the existing ffmpeg process...
[2022-06-03 08:49:10] watchdog.Reolink-RLC410W-1     INFO    : Waiting for ffmpeg to exit gracefully...
[2022-06-03 08:49:20] ffmpeg.Reolink-RLC410W-1.record ERROR   : [rtsp @ 0x55fca5e30980] method DESCRIBE failed: 401 Unauthorized
[2022-06-03 08:49:20] ffmpeg.Reolink-RLC410W-1.record ERROR   : rtsp://<correct rsp scream>: Server returned 401 Unauthorized (authorization failed)
[2022-06-03 08:49:20] watchdog.Reolink-RLC410W-1     INFO    : Terminating the existing ffmpeg process...
[2022-06-03 08:49:20] watchdog.Reolink-RLC410W-1     INFO    : Waiting for ffmpeg to exit gracefully...
[2022-06-03 08:49:30] ffmpeg.Reolink-RLC410W-1.record ERROR   : [rtsp @ 0x55caa2cc6980] method DESCRIBE failed: 401 Unauthorized
[2022-06-03 08:49:30] ffmpeg.Reolink-RLC410W-1.record ERROR   : rtsp://<correct rsp scream>: Server returned 401 Unauthorized (authorization failed)
[2022-06-03 08:49:30] watchdog.Reolink-RLC410W-1     INFO    : Terminating the existing ffmpeg process...
[2022-06-03 08:49:30] watchdog.Reolink-RLC410W-1     INFO    : Waiting for ffmpeg to exit gracefully...
[2022-06-03 08:49:40] ffmpeg.Reolink-RLC410W-1.record ERROR   : [rtsp @ 0x55b665db5980] method DESCRIBE failed: 401 Unauthorized
[2022-06-03 08:49:40] ffmpeg.Reolink-RLC410W-1.record ERROR   : rtsp://<correct rsp scream>: Server returned 401 Unauthorized (authorization failed)
[2022-06-03 08:49:40] watchdog.Reolink-RLC410W-1     INFO    : Terminating the existing ffmpeg process...
[2022-06-03 08:49:40] watchdog.Reolink-RLC410W-1     INFO    : Waiting for ffmpeg to exit gracefully...
[2022-06-03 08:49:50] ffmpeg.Reolink-RLC410W-1.record ERROR   : [rtsp @ 0x560c9bd20980] method DESCRIBE failed: 401 Unauthorized
[2022-06-03 08:49:50] ffmpeg.Reolink-RLC410W-1.record ERROR   : rtsp://<correct rsp scream>: Server returned 401 Unauthorized (authorization failed)
[2022-06-03 08:49:50] watchdog.Reolink-RLC410W-1     INFO    : Terminating the existing ffmpeg process...
[2022-06-03 08:49:50] watchdog.Reolink-RLC410W-1     INFO    : Waiting for ffmpeg to exit gracefully...
[2022-06-03 08:50:00] ffmpeg.Reolink-RLC410W-1.record ERROR   : [rtsp @ 0x55eac7b40980] method DESCRIBE failed: 401 Unauthorized
[2022-06-03 08:50:00] ffmpeg.Reolink-RLC410W-1.record ERROR   : rtsp://<correct rsp scream>: Server returned 401 Unauthorized (authorization failed)
[2022-06-03 08:50:00] watchdog.Reolink-RLC410W-1     INFO    : Terminating the existing ffmpeg process...
[2022-06-03 08:50:00] watchdog.Reolink-RLC410W-1     INFO    : Waiting for ffmpeg to exit gracefully...
[2022-06-03 08:50:10] ffmpeg.Reolink-RLC410W-1.record ERROR   : [rtsp @ 0x56271923d980] method DESCRIBE failed: 401 Unauthorized
[2022-06-03 08:50:10] ffmpeg.Reolink-RLC410W-1.record ERROR   : rtsp://<correct rsp scream>: Server returned 401 Unauthorized (authorization failed)
[2022-06-03 08:50:10] watchdog.Reolink-RLC410W-1     INFO    : Terminating the existing ffmpeg process...
[2022-06-03 08:50:10] watchdog.Reolink-RLC410W-1     INFO    : Waiting for ffmpeg to exit gracefully...

FFprobe output from your camera

no issue with cameras, they are all working flawlessly & accurately detecting what they should be.

Frigate stats

No response

Operating system

Other

Install method

Docker CLI

Coral version

CPU (no coral)

Network connection

Mixed

Camera make and model

Reolink 511, 410 (wireless) and some (wired) IP intercom

Any other information that may be helpful

No response

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 47 (17 by maintainers)

Most upvoted comments

There’s been quite a few users in this thread that reported some memory leak like behavior and there are a lot of differences between them (some on beta, some on 0.10, some seeing it in tmp/cache, some seeing it in the ffmpeg process, different kinds of hwaccel, etc) so it seems to me there likely won’t be a clear cut answer. A different version of ffmpeg will be used in the next beta release that should hopefully fix this for those seeing ffmpeg process memory issues on the beta

appears that the new beta release fixed my memory issues

The role must be cleared out and rtmp -> enabled: false be set.

For recording, as long as recording -> enabled: false is set then it being on from MQTT won’t matter as it is disabled fully if not enabled in the config.

but I had a similar memory issue that was resolved immediately after clearing /media/frigate/, see first comment in this thread for a screenshot. It’s possible that the OP’s issue is unrelated, but since we’re experiencing similar symptoms at a similar time I think it’s worth a try.

We’ve seen this in a number of places due to this upgrade -> downgrade path. In any case we’d be seeing DB errors in the docker logs if this was the case since frigate doesn’t rely on any media files for constant running, and only DB and media files are kept in /media. OP doesn’t have these errors 👍

Similar issue with me since updating to the latest version - restarting the frigate add-on on HassOS clears the occupied ram. An automation does this for me automatically at the moment.

A061D75D-6FB0-41EB-9CA4-F09C888C3B2E