I'm not exactly sure what's going on, but reverting to the 1.8.5 version of the ARM arduino IDE resolves it and that's what I've done for this family of chips.
It appears to be a combination of ARM Arduino IDE>1.8.5 and the ESP8266 libs. IDE v1.8.9 works great on ARM for BB uproc and every arduino varient I've thrown at it (nano, pro mini, uno, etc.).
Also, v1.8.9 on either 32 or 64 bit Intel works fine for all including ESP8266.
Running top when I fire off a compile for a D1 mini in IDE >1.8.5 I see it go into an absolute forkfest, spawning cc1plus processes until Virtual Memory is exhausted and the Pi hangs. It's like OOM never has a chance.
I know the rPi is not the optimal place to run the IDE but I have sensors in isolated places and it's nice to be able to hook a wifi enabled pi to a cell phone battery charger, cable it up, and toss IDE's X back to somewhere comfortable while I debug or update a remote sensor in place.
I've duplicated it on Raspian Stretch and Buster, IDE versions 1.8.7-9. Again, ARM only. Intel works fine. To duplicate you can take the blink sketch and simply include th3 8266 libs. Blink compiles fine without the includes, goes nuts with, e.g.:
/*
* Blink
* Turns on the onboard LED on for one second, then off for one second, repeatedly.
* This uses delay() to pause between LED toggles.
*/
#include <ESP8266WiFi.h> // Causes recursive fork during compile
void setup() {
pinMode(BUILTIN_LED, OUTPUT); // initialize onboard LED as output
}
void loop() {
digitalWrite(BUILTIN_LED, HIGH); // turn on LED with voltage HIGH
delay(1000); // wait one second
digitalWrite(BUILTIN_LED, LOW); // turn off LED with voltage LOW
delay(1000); // wait one second
}
If I'm running top in another window, I see:
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
46 root 20 0 0 0 0 R 15.7 0.0 0:00.69 kswapd0
816 leem 20 0 444416 115748 5524 S 12.5 12.2 0:47.06 java
1196 leem 20 0 35672 25336 5412 R 12.5 2.7 0:01.04 cc1plus
1089 leem 20 0 33624 24836 5348 R 10.2 2.6 0:01.08 cc1plus
1104 leem 20 0 33504 24472 5264 R 10.2 2.6 0:01.04 cc1plus
1062 leem 20 0 35608 25500 5348 R 9.9 2.7 0:01.15 cc1plus
<repeat cc1plus procs until I run out of screen, swap, pi hangs>
If any devs are reading thank you so much for this GREAT product! I'm a financial contributor and use the heck out of it. While I edit code remotely I love the simplicity of board, library and option management the IDE provides. It so beats Makefiles and scripted up avrdude calls. Awesome work.
Cheers!
Lee