home-assistant / operating-system

:beginner: Home Assistant Operating System
Apache License 2.0
4.8k stars 959 forks source link

Occasionally high memory usage #3483

Closed nazar-pc closed 2 months ago

nazar-pc commented 2 months ago

Describe the issue you are experiencing

I believe this is the third time this happened to me. Home Assistant is usually running fine for days with stable memory usage and then suddenly memory usage is growing significantly. Once it hanged the whole thing, two more times (including today) just resulted in high memory usage and monitoring alerts: Знімок екрана з 2024-07-22 12-57-18

I looked inside and python3 -m homeassistant --config /config is the process that is currently using 56.6% of RAM (on VM with just 2G of RAM).

Memory usage started to recover for some reason, have not done anything to cause that :man_shrugging: Home Assistant is not reachable from public Internet.

There is no records in Home Assistant Core logs. Supervisor logs have this, looks like it restarted today, though no idea why it would do that (doesn't correlate with the memory usage increase either):

2024-07-22 09:34:07.792 INFO (MainThread) [supervisor.resolution.fixup] Starting system autofix at state running
2024-07-22 09:34:07.793 INFO (MainThread) [supervisor.resolution.fixup] System autofix complete
2024-07-22 09:35:04.575 INFO (MainThread) [supervisor.updater] Fetching update data from https://version.home-assistant.io/stable.json
2024-07-22 09:35:16.031 INFO (MainThread) [supervisor.homeassistant.api] Updated Home Assistant API token
2024-07-22 09:35:18.259 INFO (MainThread) [supervisor.store.git] Update add-on https://github.com/loganmarchione/hassos-addons repository
2024-07-22 09:35:18.271 INFO (MainThread) [supervisor.store.git] Update add-on https://github.com/music-assistant/home-assistant-addon repository
2024-07-22 09:35:18.277 INFO (MainThread) [supervisor.store.git] Update add-on https://github.com/esphome/home-assistant-addon repository
2024-07-22 09:35:18.282 INFO (MainThread) [supervisor.store.git] Update add-on https://github.com/home-assistant/addons repository
2024-07-22 09:35:18.289 INFO (MainThread) [supervisor.store.git] Update add-on https://github.com/hassio-addons/repository repository

Nothing interesting in any other logs.

What operating system image do you use?

ova (for Virtual Machines)

What version of Home Assistant Operating System is installed?

12.4

Did the problem occur after upgrading the Operating System?

No

Hardware details

KVM x86-64 VM (UEFI) on Ubuntu 23.10 managed by libvirt. QEMU 8.0.4, libvirtd 9.6.0, 6.5.0-44-generic kernel from Ubuntu.

Home Assistant SkyConnect (10c4:ea60) and Realtek RTL8761B (0bda:8771) USB devices passed through to VM.

Steps to reproduce the issue

Just run Home Assistant in a VM, nothing special was done to cause this

Anything in the Supervisor logs that might be useful for us?

Shared above

Anything in the Host logs that might be useful for us?

Nothing interesting

System information

System Information

version core-2024.7.0
installation_type Home Assistant OS
dev false
hassio true
docker true
user root
virtualenv false
python_version 3.12.4
os_name Linux
os_version 6.6.33-haos
arch x86_64
timezone Europe/Kiev
config_dir /config
Home Assistant Community Store GitHub API | ok -- | -- GitHub Content | ok GitHub Web | ok GitHub API Calls Remaining | 5000 Installed Version | 1.34.0 Stage | running Available Repositories | 1387 Downloaded Repositories | 2
Home Assistant Cloud logged_in | false -- | -- can_reach_cert_server | ok can_reach_cloud_auth | ok can_reach_cloud | ok
Home Assistant Supervisor host_os | Home Assistant OS 12.4 -- | -- update_channel | stable supervisor_version | supervisor-2024.06.2 agent_version | 1.6.0 docker_version | 26.1.4 disk_total | 30.8 GB disk_used | 10.8 GB healthy | true supported | true host_connectivity | true supervisor_connectivity | true ntp_synchronized | true virtualization | kvm board | ova supervisor_api | ok version_api | ok installed_addons | Advanced SSH & Web Terminal (18.0.0), File editor (5.8.0), SQLite Web (4.2.0), Mosquitto broker (6.4.1), Prometheus Node Exporter (1.0.0)
Dashboards dashboards | 2 -- | -- resources | 0 views | 2 mode | storage
Recorder oldest_recorder_run | 16 липня 2024 р. о 08:50 -- | -- current_recorder_run | 20 липня 2024 р. о 15:34 estimated_db_size | 517.79 MiB database_engine | sqlite database_version | 3.45.3

Additional information

No response

sairon commented 2 months ago

If the offending process is python3 -m homeassistant --config /config, it means the issue lies in the Home Assistant Core, there's very likely no relation with the underlying OS. To get proper support, if the issue appears again, report it in the Core repository. In the meantime, you might want to have a look at the profiler integration and/or a bdraco's post about integration troubleshooting.

github-actions[bot] commented 2 months ago

:wave: @nazar-pc, thanks for reporting an issue!

It looks like this issue is related to Home Assistant Core. Please check the Home Assistant Core repository, the issue might have been reported already. Open a new issue in that repository if you can't find a matching issue.