ESP Home crashes HA

whenever I try to install a .yaml file HA gets unresponsive.
the log is showing this:

INFO Reading configuration /config/esphome/slimmelezer.yaml...
INFO Generating C++ source...
INFO Core config or version changed, cleaning build files...
INFO Deleting /data/slimmelezer/.pioenvs
INFO Deleting /data/slimmelezer/.piolibdeps
INFO Compiling app...
INFO Running:  platformio run -d /config/esphome/slimmelezer
Processing slimmelezer (board: d1_mini; framework: arduino; platform: platformio/[email protected])
--------------------------------------------------------------------------------
HARDWARE: ESP8266 80MHz, 80KB RAM, 4MB Flash
PACKAGES: 
 - framework-arduinoespressif8266 3.20704.0 (2.7.4) 
 - tool-esptool 1.413.0 (4.13) 
 - tool-esptoolpy 1.20800.0 (2.8.0) 
 - toolchain-xtensa 2.40802.200502 (4.8.2)
Library Manager: Installing Update
Library Manager: Already installed, built-in library
Dependency Graph
|-- <ESPAsyncTCP-esphome> 1.2.3
|   |-- <ESP8266WiFi> 1.0
|-- <ESPAsyncWebServer-esphome> 1.3.0
|   |-- <ESPAsyncTCP-esphome> 1.2.3
|   |   |-- <ESP8266WiFi> 1.0
|   |-- <Hash> 1.0
|   |-- <Crypto> 0.2.0
|   |-- <ESP8266WiFi> 1.0
|   |-- <ArduinoJson-esphomelib> 5.13.3
|-- <ESP8266WiFi> 1.0
|-- <ESP8266mDNS> 1.2
|   |-- <ESP8266WiFi> 1.0
|-- <ArduinoJson-esphomelib> 5.13.3
|-- <Dsmr> 0.3.0
|-- <Crypto> 0.2.0
|-- <DNSServer> 1.1.1
|   |-- <ESP8266WiFi> 1.0
Compiling /data/slimmelezer/.pioenvs/slimmelezer/src/esphome/components/api/api_connection.cpp.o
Compiling /data/slimmelezer/.pioenvs/slimmelezer/src/esphome/components/api/api_pb2.cpp.o
Compiling /data/slimmelezer/.pioenvs/slimmelezer/src/esphome/components/api/api_pb2_service.cpp.o
Compiling /data/slimmelezer/.pioenvs/slimmelezer/src/esphome/components/api/api_server.cpp.o

but the complete webinterface gets unresponsive.
I attached a console to check what happends. And the output is this:
I get this 10 times with increasing seconds:

[ 1841.125552] INFO: task kworker/0:05959 blocked for more than 122 seconds.
[ 1841.125731]	Tainted: G   C	5.10.17-v7 #1
[ 1841.125844] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this messages.

after 10 times I get an out of memory exception.

[ 5578.596640] Out of memory: Killed process 4338 (python3) total-vm:264092kB, anon-rss:93560kB, file-res:0kB, shmem-rss:0kB, UID:0 pgtables:264kB oom_score_adj:0
[ 5585.445159] systemd-coredump[8083]: Process 112 (systemd-jouirnal) of user 0 dumped core.

Can anyone tell me what I’m doing wrong here?
Thank you.

You are probably nothing doing wrong. What system are you running HA on ?

I’m running HA 2021.9.1 on a Raspberry Pi3A

There you go, it does not have enough memory to run the ESP toolchain and the HA python process at the same time, so SystemD decides to kill HA to make sure the kernel has enough memory to keep the system from crashing completely

ok, thank you, that’s clear
my rpi3A has 512MB of memory.
the 3B model has 1GB of memory, would that be enough?
I know rpi4 is suggested but that one consumes to much power imho.

(for now. I managed to update the file using windows command line.)

esphome needs about a gig to compile

You don’t have to run esphome on the same computer as ha.

@bkbartk, it is for this reason I upgraded from a Pi3 to a Nuc. I’ve never had a problem compiling ESPHome sources since. It seems like there should be a big warning thrown up anytime someone compiles on a system that has limited RAM that “a hang may occur”. Every time it happened on my Pi it took down the whole thing and I had to reset it worrying that I was going to have a corrupt SD card. I dealt with that stupid problem for months before coming to the realization that I needed to upgrade to fix it.

I upgraded to a Nuc i3 about a year and a half ago. Best move I ever made. H.A. is rock-solid stable now. When I do restart, it’s running in just a few seconds. Node-Red deploy takes three or four seconds.