Memory Usage monitoring

I was seeing a continual rise in memory usage on my system so decided to monitor the situation. Only been running for a day but some intriguing patterns are emerging. System is HA Supervised on an RPi4-4GB Raspbian (unsupported), boot from SD and rootfs on an SSD.

I have installed ‘Glances’ (great add-on) and am uploading data into InfluxDB - all metrics shown are mem_usage - I do have more add-ons / containers than this :grinning:. Some of the scales are not properly setup, but they are all the same.

Something happened at about 01:37 local with a few components dropping mem usage and supervisor mem usage rising sharply. There is nothing in the logs to indicate why memory usage drops in many containers just after 2am.

log

/var/log/daemon.log:May  6 01:37:59 hassio hassio-supervisor[1710]: #033[32m20-05-06 00:37:59 INFO (MainThread) [supervisor.updater] Fetch update data from https://version.home-assistant.io/stable.json#033[0m
/var/log/daemon.log:May  6 01:38:31 hassio hassio-supervisor[1710]: #033[32m20-05-06 00:38:31 INFO (MainThread) [supervisor.api.security] /snapshots access from cebe7a76_hassio_google_drive_backup#033[0m
/var/log/daemon.log:May  6 01:38:33 hassio hassio-supervisor[1710]: #033[32m20-05-06 00:38:33 INFO (MainThread) [supervisor.api.security] /homeassistant/info access from cebe7a76_hassio_google_drive_backup#033[0m
/var/log/daemon.log:May  6 01:38:33 hassio hassio-supervisor[1710]: #033[32m20-05-06 00:38:33 INFO (MainThread) [supervisor.api.security] /supervisor/info access from cebe7a76_hassio_google_drive_backup#033[0m
/var/log/daemon.log:May  6 01:38:33 hassio hassio-supervisor[1710]: #033[32m20-05-06 00:38:33 INFO (MainThread) [supervisor.api.security] /snapshots/new/full access from cebe7a76_hassio_google_drive_backup#033[0m
/var/log/daemon.log:May  6 01:38:33 hassio hassio-supervisor[1710]: #033[32m20-05-06 00:38:33 INFO (MainThread) [supervisor.snapshots] Full-Snapshot 8a5bbce0 start#033[0m
/var/log/daemon.log:May  6 01:38:33 hassio hassio-supervisor[1710]: #033[32m20-05-06 00:38:33 INFO (MainThread) [supervisor.snapshots] Snapshot 8a5bbce0 store Add-ons#033[0m
/var/log/daemon.log:May  6 01:38:33 hassio hassio-supervisor[1710]: #033[32m20-05-06 00:38:33 INFO (MainThread) [supervisor.addons.addon] Build snapshot for add-on core_mosquitto#033[0m
/var/log/daemon.log:May  6 01:38:33 hassio hassio-supervisor[1710]: #033[32m20-05-06 00:38:33 INFO (MainThread) [supervisor.addons.addon] Build snapshot for add-on a0d7b954_sonweb#033[0m
/var/log/daemon.log:May  6 01:38:33 hassio hassio-supervisor[1710]: #033[32m20-05-06 00:38:33 INFO (MainThread) [supervisor.addons.addon] Build snapshot for add-on 7ad98f9c_zigbee2mqtt#033[0m
/var/log/daemon.log:May  6 01:38:33 hassio hassio-supervisor[1710]: #033[32m20-05-06 00:38:33 INFO (MainThread) [supervisor.addons.addon] Build snapshot for add-on core_samba#033[0m
/var/log/daemon.log:May  6 01:38:33 hassio hassio-supervisor[1710]: #033[32m20-05-06 00:38:33 INFO (MainThread) [supervisor.addons.addon] Build snapshot for add-on a0d7b954_adguard#033[0m
/var/log/daemon.log:May  6 01:38:33 hassio hassio-supervisor[1710]: #033[32m20-05-06 00:38:33 INFO (MainThread) [supervisor.addons.addon] Build snapshot for add-on core_nginx_proxy#033[0m

I will also note that, I have not made any configuration changes, but after the last reboot just before I started this collection, the gradual rise in memory usage seems to have stopped!

After 30 days of monitoring, I am quite happy with memory usage - seems stable over the longer term. Longest run period has been about 6 days between reboots. Swap % drops as I increased the size of the swap.