Memory leak: How to find whats causing it?

Since a few weeks my HA has a major problem with a memory leak.
HA container gets bigger an bigger over the day, until HA gets unresponsive.
At the moment my “solution” is to run a automation that restarts my HA every night.
I was never able to find the reason that is causing the memory leak.
Is there a way to solve this?
I run the latest version of HA and all installed extensions on a 4Gb Raspberry 4.

You could connect to the Pi and use “docker stats” to show you the current memory usage of each container. This would narrow it down to (probably) an add-on.

Note that you can’t use a terminal add-on to do this, as that runs in a container itself and does not have access to docker commands. If you don’t have the Pi connected to a monitor and keyboard, you can use SSH over port 22222 to connect, if this has been configured. This addon simplifies configuring the port.

Problem is, it is the Home Assistant container itself, that increases the memory.
Whats causing the problem inside is not visible for me.
I have attached a screenshot taken using glances.

Youll need to go in with docker exec -it homeassistant bash then run top, free or do other troubleshooting within the container. Your 4G of RAM is a bit low. You may need more.

Okay. Thanks for that. Tried top, and there is a Python process inside the HA container that seems to produce most of the load.

Hello!
Did you solve this problem?
Looks like I have the same…

Actually not.
My “solution” at the moment is, to restart the HA container daily at night, where no one / nothing is really using it.

Well my ha instance is currently using little less than 1 GB of ram. This is not concern for me as I have 20 gb. As I saw from your post you probably don’t use docker based installation. In docker you can easily manage mem and cpu consumption by containers. You can try to limit memory usage for this container in portainer but this is not permanent solution. It will wok till you restart ha. In my opinion only permanent solution will be to move to docker based installation on a normal pc.