MariaDB Memory Creep

I’ve been trying to track down a suspected memory leak. I’m running HA 0.99.3 on a Raspberry Pi 3 for about a year now without too much issue. Over the past couple of months I’ve noticed the memory usage getting close to 100%. The system becomes unresponsive and the only thing that resolves it is a hard reboot of the raspberry pi. Also, I’ve tried just a restart of HA but that doesn’t resolve it. It has to be a hard reset of the device.

I disabled all of my add-ons and slowly re-added one at a time and I’ve got it narrowed down to MariaDB. Over a period of 4-5 days the memory usage will steadily creep from about 40% after reboot, to 95%+ until a system reset is required. If I disable mariadb the memory stays steady at about 33% and doesn’t increase.

Anyone else having this issue with MariaDB and know how to fix it?

Anyone else having this issue with MariaDB and know how to fix it?

I’m using MariaDB on a synology NAS and don’t have the memory leak issue, but do fine it can use quite a lot of memory when caching in order to speed things up.

I’ve found keeping the DB size under 1GB helps a little.

Ive got it set to purge the database every 7 days. With that setting and the number of entities Im tracking it stays at about 1.1G.

And mine doesnt seem to use allot of memory initially, only about 10% difference when I first start it. But it’s got that slow creep up.

In case anyone finds this, it wasn’t MariaDB that was causing the memory issue. It was influx. I was running MariaDB, influx and grafana. Grafana requires influx for it’s graphs. Every time I start up influx within a short amount of time it maxes out the memory. No influx, no memory creep.