Closed facchinm closed 5 years ago
@ArduinoBot build this please
:white_check_mark: Build completed.
:arrow_down: Build URL: http://downloads.arduino.cc/PR/arduino-builder/arduino-builder-331.zip
:information_source: To test this build:
arduino-builder
binary (you can find it where you installed the IDE) with the provided onemerged and fixed in https://github.com/arduino/arduino-cli/pull/356
The issue was due to the peculiar way concurrency and parallelism are handled in go. We used to set GOMAXPROC to 1 to avoid parallelizing the WaitGroup execution. This would work, in theory, unless the goroutines sleep. In that case, another goroutine is allowed to start concurrently (only 1 goroutine running in parallel, so GOMAXPROC is happy). Since our goroutines sleep (wait) after calling gcc, another task is started, without any hard limit, till the WaitGroup is completely spawned. On systems with limited resources (as RaspberryPi) and cores with lots of files this can trigger an out of memory condition.