question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

(Solved) Memory usage constantly increasing[Support]:

See original GitHub issue

Describe the problem you are having

Memory usage of system constantly (but slowly) ever increasing due to frigate addon. System starts at approx 5% memory usage and constantly rises at a steady linear rate over several days to as high as over 80%.

Restarting the frigate addon resets it back to approx 5%.

Hardware: Intel®NUC Board NUC7i3BNB 16 GB RAM

Version

0.11.1-2EADA21

Frigate config file

mqtt:
  host: 192.168.1.28
  port: 1883
  user: mqttuser
  password: XXXXX
ffmpeg:
  hwaccel_args:
    - -hwaccel
    - vaapi
    - -hwaccel_device
    - /dev/dri/renderD128
    - -hwaccel_output_format
    - yuv420p
cameras:
  front_room_cam_frigate:
    ffmpeg:
      inputs:
        - path: rtsp://xxx:xxx@192.168.1.86:554
          roles:
            - rtmp
            - detect
            - record
      output_args:
        record: -f segment -segment_time 10 -segment_format mp4 -reset_timestamps 1 -strftime 1 -c:v copy -c:a aac
    detect:
      width: 768
      height: 432
      fps: 5
      enabled: true
      max_disappeared: 25
      stationary:
        max_frames:
          default: 1500
    objects:
      track:
        - person
      filters:
        person:
          min_area: 20000
    motion:
      mask:
        - 534,432,768,432,768,411,533,411
    rtmp:
      enabled: true
    mqtt:
      enabled: true
      timestamp: true
      bounding_box: true
      crop: true
    record:
      enabled: true
      retain:
        days: 0
      events: 
        pre_capture: 5
        post_capture: 5
        objects:
          - person
        retain:
          default: 30
    snapshots:
      enabled: true
      timestamp: true
      bounding_box: true
      retain:
        default: 30
    best_image_timeout: 30
    live:
      height: 432
      quality: 12
  chn_zero_frigate:
    ffmpeg:
      inputs:
        - path: rtsp://xxx:xxx@192.168.1.20:554/Streaming/channels/001
          roles:
            - rtmp
    detect:
      width: 704
      height: 576
      fps: 5
      enabled: false
    live:
      height: 576
      quality: 12
  stgb_chn_zero_frigate:
    ffmpeg:
      inputs: 
        - path: rtsp://xxx:xxx:xxx:10554/Streaming/Channels/001
          roles:
            - rtmp
    detect:
      width: 704
      height: 576
      fps: 5
      enabled: false
    live:
      height: 576
      quality: 12
  garage_cam:
    ffmpeg:
      inputs:
        - path: rtsp://xxx:xxx@192.168.1.20:554/Streaming/channels/102
          roles:
            - detect
            - rtmp
            - record            
    detect:
      width: 704
      height: 576
      fps: 5
      enabled: true
      max_disappeared: 25
      stationary:
        max_frames:
          default: 3000
    motion:
      mask:
        - 0,35,179,33,180,0,0,0          
    objects:
      track:
        - person
      filters:
        person:
          min_area: 7000
          max_area: 145000        
    rtmp:
      enabled: true
    mqtt:
      enabled: true
      timestamp: true
      bounding_box: true
      crop: true
      required_zones:
        - home_garage_person_zone
    record:
      enabled: true
      retain:
        days: 0
      events: 
        required_zones:
          - home_garage_person_zone
        pre_capture: 5
        post_capture: 5
        retain:
          default: 30
    snapshots:
      required_zones:
        - home_garage_person_zone
      enabled: true
      timestamp: true
      bounding_box: true
      retain:
        default: 30    
    best_image_timeout: 30
    zones:
      home_garage_person_zone:
        coordinates: 0,576,704,576,704,306,600,197,460,64,262,57,0,68
    live:
      height: 576
      quality: 12
  conservatory_cam:
    ffmpeg:
      inputs:
        - path: rtsp://xxx:xxx@192.168.1.20:554/Streaming/channels/202
          roles:
            - detect
            - rtmp            
        - path: rtsp://xxx:xxx@192.168.1.20:554/Streaming/channels/201
          roles:
            - record            
    detect:
      width: 704
      height: 576
      fps: 5
      enabled: true
      max_disappeared: 25
      stationary:
        max_frames:
          default: 3000          
    objects:
      track:
        - person
      filters:
        person:
          min_area: 25000          
    rtmp:
      enabled: true      
    snapshots:
      enabled: true
      timestamp: true
      bounding_box: true
      retain:
        default: 30       
    best_image_timeout: 30    
    mqtt:
      enabled: true
      timestamp: true
      bounding_box: true
      crop: true      
    motion:
      mask:
        - 0,31,169,32,169,0,0,0
        - 704,68,704,0,447,0        
    record:
      enabled: true
      retain:
        days: 0
      events: 
        pre_capture: 5
        post_capture: 5
        retain:
          default: 30
    live:
      height: 576
      quality: 12          
  garden_cam:
    ffmpeg:
      inputs:
        - path: rtsp://xxx:xxx@192.168.1.20:554/Streaming/channels/302
          roles:
            - detect
            - rtmp                     
        - path: rtsp://xxx:xxx@192.168.1.20:554/Streaming/channels/301
          roles:
            - record            
    detect:
      width: 704
      height: 576
      fps: 5
      enabled: true
      max_disappeared: 25
      stationary:
        max_frames:
          default: 3000          
    rtmp:
      enabled: true          
    objects:
      track:
        - person
      filters:
        person:
          min_area: 10000      
    snapshots:
      enabled: true
      timestamp: true
      bounding_box: true
      retain:
        default: 30
    best_image_timeout: 30        
    mqtt:
      enabled: true
      timestamp: true
      bounding_box: true
      crop: true      
    motion:
      mask:
        - 0,31,169,32,169,0,0,0
        - 704,132,704,0,543,0,539,30        
    record:
      enabled: true
      retain:
        days: 0
      events: 
        pre_capture: 5
        post_capture: 5
        retain:
          default: 30
    live:
      height: 576
      quality: 12          
  front_door_cam:
    ffmpeg:
      inputs:
        - path: rtsp://xxx:xxx@192.168.1.20:554/Streaming/channels/402
          roles:
            - detect
            - rtmp            
        - path: rtsp://xxx:xxx@192.168.1.20:554/Streaming/channels/401
          roles:
            - record            
    detect:
      width: 704
      height: 576
      fps: 5
      enabled: true
      max_disappeared: 25
      stationary:
        max_frames:
          default: 3000          
    objects:
      track:
        - person
      filters:
        person:
          min_score: 0.4
          threshold: 0.6
          min_area: 3000
          max_area: 40000            
    rtmp:
      enabled: true      
    snapshots:
      enabled: true
      timestamp: true
      bounding_box: true
      retain:
        default: 2
    best_image_timeout: 30        
    mqtt:
      enabled: true
      timestamp: true
      bounding_box: true
      crop: true
      required_zones:
        - home_front_perimeter
    motion:
      mask:
        - 0,576,321,576,166,96,492,21,555,83,511,156,517,289,704,548,704,0,0,0        
    zones:
      home_front_perimeter:
        coordinates: 240,431,432,345,283,116,156,121
        objects:
          - person
      home_external_perimeter:
        coordinates: 508,142,530,236,480,248,406,282,298,127,432,77
        objects:
          - person          
    record:
      enabled: true
      retain:
        days: 0
      events: 
        pre_capture: 5
        post_capture: 5
        retain:
          default: 30
    live:
      height: 576
      quality: 12          
  stgb_entrance:
    ffmpeg:
      inputs:
        - path: rtsp://xxx:xxx@xxx:10554/Streaming/Channels/102
          roles:
            - detect
            - rtmp
        - path: rtsp://xxx:xxx@xxx:10554/Streaming/Channels/101
          roles:
            - record
    detect:
      width: 640
      height: 360
      fps: 6
      enabled: true
      max_disappeared: 25
      stationary:
        max_frames:
          default: 3000          
    objects:
      track:
        - person
      filters:
        person:
          min_area: 500
    motion:
      mask:
        - 0,360,130,360,432,139,212,91,519,0,214,0,0,0        
    zones:
      stgb_entrance_steps:
        coordinates: 304,360,640,360,640,196,430,116,434,152
        objects:
          - person        
    rtmp:
      enabled: true      
    snapshots:
      enabled: true
      timestamp: true
      bounding_box: true
      required_zones:
        - stgb_entrance_steps
      retain:
        default: 30
    best_image_timeout: 30        
    mqtt:
      enabled: true
      timestamp: true
      bounding_box: true
      crop: true
      required_zones:
        - stgb_entrance_steps
    record:
      enabled: true
      retain:
        days: 0
      events: 
        pre_capture: 5
        post_capture: 5
        required_zones:
          - stgb_entrance_steps
        retain:
          default: 30
    live:
      height: 360
      quality: 12
  stgb_parking:
    ffmpeg:
      inputs:
        - path: rtsp://xxx:xxx@xxx:10554/Streaming/Channels/402
          roles:
            - detect
            - rtmp          
        - path: rtsp://xxx:xxx@xxx:10554/Streaming/Channels/401
          roles:
            - record
    detect:
      width: 640
      height: 360
      fps: 6
      enabled: true
      max_disappeared: 25
      stationary:
        max_frames:
          default: 3000          
    objects:
      track:
        - person
      filters:
        person:
          min_area: 350
    motion:
      mask:
        - 640,240,640,0,155,0        
    zones:
      stgb_parking_spaces:
        coordinates: 0,360,374,360,428,290,109,75,0,91
        objects:
          - person        
    rtmp:
      enabled: true      
    snapshots:
      enabled: true
      timestamp: true
      bounding_box: true
      required_zones:
        - stgb_parking_spaces
      retain:
        default: 30
    best_image_timeout: 30        
    mqtt:
      enabled: true
      timestamp: true
      bounding_box: true
      crop: true
      required_zones:
        - stgb_parking_spaces
    record:
      enabled: true
      retain:
        days: 0
      events: 
        pre_capture: 5
        post_capture: 5
        required_zones:
          - stgb_parking_spaces
        retain:
          default: 30
    live:
      height: 360
      quality: 12     
  stgb_roller_door:
    ffmpeg:
      inputs:
        - path: rtsp://xxx:xxx@xxx:10554/Streaming/Channels/302
          roles:
            - detect
            - rtmp
        - path: rtsp://xxx:xxx@xxx:10554/Streaming/Channels/301
          roles:
            - record
    detect:
      width: 640
      height: 360
      fps: 6
      enabled: true
      max_disappeared: 25
      stationary:
        max_frames:
          default: 3000          
    objects:
      track:
        - person
      filters:
        person:
          min_area: 500
    motion:
      mask:
        - 0,169,406,128,640,175,640,0,0,0        
    zones:
      stgb_side_of_unit:
        coordinates: 0,360,640,360,640,196,536,154,0,215
        objects:
          - person        
    rtmp:
      enabled: true      
    snapshots:
      enabled: true
      timestamp: true
      bounding_box: true
      required_zones:
        - stgb_side_of_unit
      retain:
        default: 30
    best_image_timeout: 30        
    mqtt:
      enabled: true
      timestamp: true
      bounding_box: true
      crop: true
      required_zones:
        - stgb_side_of_unit
    record:
      enabled: true
      retain:
        days: 0
      events: 
        pre_capture: 5
        post_capture: 5
        required_zones:
          - stgb_side_of_unit
        retain:
          default: 30
    live:
      height: 360
      quality: 12      
  stgb_reception:
    ffmpeg:
      inputs:
        - path: rtsp://xxx:xxx@xxx:10554/Streaming/Channels/202
          roles:
            - detect
            - rtmp
        - path: rtsp://xxx:xxx@xxx:10554/Streaming/Channels/201
          roles:
            - record
    detect:
      width: 640
      height: 360
      fps: 6
      enabled: true
      max_disappeared: 25
      stationary:
        max_frames:
          default: 3000          
    objects:
      track:
        - person
      filters:
        person:
          min_area: 3000          
    zones:
      stgb_reception_area:
        coordinates: 232,360,640,360,640,0,415,80,119,194
        objects:
          - person        
    motion:
      mask:
        - 224,21,229,0,229,0,0,0,0,0,0,0,0,21       
    rtmp:
      enabled: true      
    snapshots:
      enabled: true
      timestamp: true
      bounding_box: true
      retain:
        default: 30
    best_image_timeout: 30        
    mqtt:
      enabled: true
      timestamp: true
      bounding_box: true
      crop: true
    record:
      enabled: true
      retain:
        days: 0
      events: 
        pre_capture: 5
        post_capture: 5
        retain:
          default: 30
    live:
      height: 360
      quality: 12
birdseye:
  enabled: false
  quality: 10
  mode: objects
detectors:
  coral:
    type: edgetpu
    device: usb

Relevant log output

[2022-11-16 15:16:41] ws4py                          INFO    : Managing websocket [Local => 127.0.0.1:8082 | Remote => 127.0.0.1:34406]
[2022-11-16 15:16:45] ws4py                          INFO    : Terminating websocket [Local => 127.0.0.1:8082 | Remote => 127.0.0.1:34406]
[2022-11-16 15:16:46] ws4py                          INFO    : Managing websocket [Local => 127.0.0.1:8082 | Remote => 127.0.0.1:54492]
[2022-11-16 15:16:46] ws4py                          INFO    : Managing websocket [Local => 127.0.0.1:8082 | Remote => 127.0.0.1:54498]
[2022-11-16 15:23:28] ws4py                          INFO    : Managing websocket [Local => 127.0.0.1:5002 | Remote => 127.0.0.1:40818]
[2022-11-16 15:24:44] ws4py                          INFO    : Terminating websocket [Local => 127.0.0.1:5002 | Remote => 127.0.0.1:40818]

FFprobe output from your camera

Sorry but I have no idea how or where to run this command?

Frigate stats

No response

Operating system

HassOS

Install method

HassOS Addon

Coral version

USB

Network connection

Wired

Camera make and model

Multiple, mostly hikvision but some other randoms

Any other information that may be helpful

Have been running frigate for approx 1 year without this issue. Other than recently updating HA to 2011.10 and updating frigate addon and to latest version nothing has changed. The frigate.yml has not be changed since initial setup and no hardware changes have been made anywhere.

Please advise if I can provide any further info and thanks in advance for any assistance. For the time being I have an automation that restarts the addon every 24 hours.

Issue Analytics

  • State:closed
  • Created 10 months ago
  • Comments:14

github_iconTop GitHub Comments

2reactions
NickM-27commented, Nov 16, 2022

I see, I guess your CPU does not support QSV. We will likely have another update with updated drivers so perhaps the newer i965 driver won’t have this issue.

1reaction
picotrain77commented, Dec 8, 2022

I have closed this issue as for me I have solved the issue…

The issue started following a recent frigate update.

I have two chn zero cameras setup that only have the rtmp role assigned (no detect and/or record) In the frigate.yml config.

For some reason following the recent update frigate appears to have added the detect role to these two cameras even though they are only set for rtmp and is causing constant memory increases.

I have managed to disable the detection via the switch in home assistant and now my memory usage has flat lined.

Thanks for the input guys, but for me the issue is fixed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Windows 10 High Memory Usage [Causes and Solutions]
How to Fix Windows 10 High Memory Usage · Fix 1: Close unnecessary programs · Fix 2: Disable startup programs · Fix 3:...
Read more >
Fix High RAM Memory Usage Issue on Windows 11/10 ...
10 Fixes for High (RAM) Memory Usage Issue on Windows 11/10 · 1. Close Unnecessary Running Programs/Applications · 2. Disable Startup Programs ·...
Read more >
How to Fix High Memory Usage in Windows
How to Fix High Memory Usage in Windows · 1. Close Unnecessary Programs and Applications · 2. Remove Unwanted Programs from Your PC...
Read more >
High memory usage. How to fix them
1) See fixes for high RAM usage: · 2) Optimize Virtual Memory: · 3) Type Resource in Search box, open Resource Monitor as...
Read more >
High Memory Usage on Windows 10 [Solved]
High Memory Usage on Windows 10 · Step One: Run Antivirus Programs · Step Two: Disable Superfetch Service · Step Three: Run SFC...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found