Hi, no. I only restarted the terminal.
As the swap file was already there, the terminal started without the init command and everything was fine.
My question is, what will happen with this swap file in case of a ha host restart?
Will the swap file be dropped and new initiated with basic size or will the swap file be kept as it is.
In the last case, I can empty the init_command and only get it back, when I have to create a new file used (new installation).
Obviously I havent understood the command completely
I think my point was no clear… take a host reboot and let me know if all is okay or if you still get the error.
If the swap file is there it will not create it but it will try to “use” it. In your case it may already be used. When in doubt just take a host reboot and see if the problem is still there.
You definitely can. However it would be good to see the actual error along with screenshot of Glances or htop command. Either of those will highlight which memory pressures you’re dealing with.
Thanks for response @JZhass,
I received out of memory error 2 times yesterday. After that i followed your instructions and have not gotten that error again. But I can see memory usage is always more than 70- 80%.
Disable VSCode and InfluxDB and see how that goes (obviously disable writing from HA to InfluxDB as well)… The fact that your homeassistant is increasing memory suggests that one of the components you use (that could be stock and comes with HA) may have a memory leak.
@JZhass Thanks again for your response.
I have disabled VSCode and will try to disable InfluxDB for some time. But the out of memory errors i got yesterday was before installing influxDB. That suggests that issue is somewhere else.
Thank you! I have been testing a couple of dedicated thin clients for haos+Frigate and they would eventually crash with memory errors. A quick search brought me here, and so far so good - it’s been running for a couple of days with everything running perfectly.
Thanks for this. I am running a RasPi3 and I eventually hooked it up to a monitor to see why it was hanging, with no response from anything SSH, Samba etc. Just locked. The monitor revealed, that it was out of memory space, and killed the process Python3. I added your swap space command and BINGO. No more hanging.
So thanks so much for this. I think a lot of RasPi3 users could do with this.
I know this has been a while, first of all, thanks for that piece of code, my HA on a RPi3 went from lagging out every few hours to working absolutely fine.
Is it possible to integrate a swapoff /backup/_swap.swap in case it already exists in the logic? I had the plugin failing to launch even after a reboot. Quick removal of the code, starting the plugin, run the swapoff and then re-add the code and restart it fixed it. Is there a way to add to the logic to do a swapoff in case the device busy error appears (See Pirol62 output with the error he posted in this thread, that was the error i faced)
This saved my raspberry.
Thanks!
I have a Pi 4, 1gb Ram, and it got constantly slugish, especially with InfluxDB installed.
Changed to SSD; changed different USB Sata adapters, but still the same.
Then i found this! Now my raspberry runs with no problems, only logs take some minutes to load. InfluxDB is still not installed, will use it it some weeks without changing much for testing.
I have a Rpi4 1Gb ram model. I recently changed to 64 bit OS and you could see HA struggling to survive. Without this change I would have rolled back to 32 bit OS. This should definitively be part of the HA OS parameters.