#Python3 memory leak in an integration causing home assistant to restart every few minutes

16 messages · Page 1 of 1 (latest)

lyric torrent
#

I've got something causing python3 to use all my memory until it gets killed by the OOM killer. I can restart into safe mode, and that appears to fix the issue, with no obvious memory leaks, so it appears to be one or more of my integrations are broken. I just cant figure out which or what.

2024-12-11 19:01:00.055 homeassistant kernel: Out of memory: Killed process 26207 (python3) total-vm:30527252kB, anon-rss:9791084kB, file-rss:4096kB, shmem-rss:0kB, UID:0 pgtables:48876kB oom_score_adj:-300
2024-12-11 19:01:00.055 homeassistant systemd[1]: docker-46ff1e34ae1af04c28d18291817f6cd579788210f3fd32ac30ab1f8524267d90.scope: A process of this unit has been killed by the OOM killer.
2024-12-11 19:01:04.459 homeassistant systemd[1]: docker-46ff1e34ae1af04c28d18291817f6cd579788210f3fd32ac30ab1f8524267d90.scope: Deactivated successfully.
2024-12-11 19:01:04.460 homeassistant systemd[1]: docker-46ff1e34ae1af04c28d18291817f6cd579788210f3fd32ac30ab1f8524267d90.scope: Consumed 7min 6.648s CPU time.```
I'm able to start the profiler: start logging object sources, but HA restarts after just a few minutes. 

How do I figure out what's eating my RAM????
muted pawn
#

binary search enable and disable your integtations addons.

lyric torrent
#

what is binary search enable?

muted pawn
#

Well if there are 16 integrations you turn off 8

#

If the issue exists turn of 4 of the 8. Binary search ask google

lyric torrent
#

ah. you meant "binary search. enable and disable your integrations."

#

google didn't know what binary search enable meant either

lyric torrent
#

Where does object source logging log to?

#

I'm looking in the logs, where do I see what is growing in memory size?

#

only log I see in core is ```Logger: homeassistant.components.profiler
Source: components/profiler/init.py:564
integration: Profiler (documentation, issues)
First occurred: 4:28:43 PM (1 occurrences)
Last logged: 4:28:43 PM

New object tuple (0/116492) at ["Failed to serialize <class 'list'>", '(b"\xc1~\x01\x1f\xec\xfd\t\x80\x1cE\xf9\xbf\x81\xf7f7\xd7$\x9b\x04@EER\x04 \t\xcc.\xbb\x9b;\x81$\xbb\xb9!\x17I\xb8\x04\x85\xde\x99\xde\x9d&3\xd3C\xf7L6\x8b\x08\xf1VQ\xc1\xfbVT\xc4[Q\xf1\x16\r\x89\x8a7x\xdf\x1aE\x05\xef \xaa\xa0\x90\xfd\xff\x9f\xf7\xad\x9e\xa9\xdd\xddp\xfa\xfd\xfd\xbe\xbf\xff\xdf\xcdfg\xba\xbb\xaa\xea}\xdfz\xeb\xadO\xbd\xf5V\xb5f\xeb\\T\xcf&\xf3\xd5Y\xd9Y\xfa\xb9\xf4\x19\xe9}?\x9f\x97\xfd?\xae\xf0\xa4\x11\xac\x9b\xc3\xfa%\xec\xcc\x1d\xcfA?xl\xe93f\xd9\x16\x9c\xb5t\xd6\x16Ib4\x89\xb1IL\xc1O\x8c\x8csA\xbe\xddl\x0f\x02sa\xb5\x10\xf04y\xda\x9c\xd3t\x12z\x1aWsM52U\xdcC\x86\x04\xfdq4P-\x98\xa8\xcf\x94\x83\x01\xa3\xb5'\xed#(\xbc\x18\xeeRO\xccaH\xcc\xce\xaa\x86\x04``` etc etc. (cant post the whole thing because apparently it's over 2000 characters

#

meantime in glances "homeassistant" is using 100.7 percent cpu and growing in ram continously

#

I restarted in safe mode, which told me there were 11 integrations disabled. I wrote those down, and selected 4 of them to disable, then restarted out of safe mode. It's now still using 100.7 percent cpu for homeassistant in glances, and the RAM is still building continuously, but slower than before

#
-
homeassistant
running
22 mins
102.5
9.63G
11.6G
70Kb
3Kb
NaNb
NaNb
/init```
#

just keeps eating ram until switching it into SWAP, then crashes HA altogether

muted pawn
#

9 gig for home assistant?

lyric torrent
#

What is normal? I eventually got it to stop but really don't know why. I disabled several integrations, but they're all re-enable now, so no idea what was causing the issue