In some test runs in Ubuntu this crashed due to an OOM so it seems to be sized rather thightly. Reduce the current use of $nproc to a static one (1) to avoid too much pressure.
From my tests: nproc=4 = 1.5G fail, 3G fail, 4G fail, 8G work nproc=1 = 1.5G fail, 3G work