`nixos-rebuild` causes crashes, instability

I have zramSwap.enable = true and tmp.useTmpfs = true (with tmp.tmpfsSize = 30%). Perhaps I’m asking too much of 24GB RAM during larger builds?

I killed the build on my desktop, commented out telegram-desktop and re-ran, and noticed ~35 threads of .java-wrapped from a store path for temurin-bin (I guess, a dependency for something). I had the build running over ssh and the last thing in the terminal before the ssh connection got killed by OOM was electron-unwrapped-33.3.0 (buildPhase): [2199/41550] AR obj/third_party/icu/libicuuc.a. This time the OOM killed the window manager, but building is still ongoing.

Thanks, both, for the tips – I’ll take tmp out of tmpfs (though I have nix building out of this directory as this was previously cancelling builds due to running out of space. It’s currently only got about 4KB out of 7GB used) and change zram swap for physical swap space, and also check out @waffle8946 's link for tuning the build jobs

Edit: Related: this post, will try the recommendations there, also.