`Out of memory` error on KVM install of Home Assistant

I migrated from VirtualBox to KVM maybe 2 months ago and have a few VMs running on a 20GB Intel i5 machine. Rebuilt HA from scratch as I wanted to make certain changes. All seemingly well.

Of late I’ve been getting these Out of memory errors on the console.

The VM has 4GB of RAM / 2 vCPUs and I noticed the spikes in memory consumption on the next picture

is when these out of memory errors keep appearing.

I have noticed all this as the response on the browser was very sluggish or I couldn’t open files altogether in VSC and at times I was getting these disconnect errors in VSC when editing files or I can’t even open a log file.

What has changed? I had switched on debug for various components for a while. The home-assistant_v2.db file has grown to 200MB (not sure this is big or not). After reading up I have deleted that file and saw a new one was created (not fussed about historical data at this point). The file size is 7MB after less than 24hrs.

I also have installed a few integrations in the meantime.

Does this ring any bells? What other diagnostic info can I present/collect to get further insights here?

That’s a lot of CPU usage. My HA is usually 2-3%.

Yeah and for no obvious reasons do I see these spikes. I don’t have a lot of devices/entities.

Are you running a VM as well, @PeteRage?

I’m using docker. My overall CPU usage on the box is less than 10%, and that’s for running HA, zwavejs2mqtt, 6 cameras and recording sw.

I have seen other topics here on excessive CPU. Those could be worth searching for.

Looks like I found the culprit. Given I had an issue of not being able to use the VSC add-on I have removed and re-added it.

Memory consumption is down to 2GB and CPU load <20%. Still higher than @PeteRage with 6 cameras, recording SW and zwavejs2mqtt but I’m sure the VM adds an extra layer here.

If it stays like this I’m happy. Will monitor for a few days before closing this.