Description
Describe the bug
I'm not sure if this counts as a bug report or feature request.
Basically currently nix build
won't release the pages allocated for evaluation while waiting for nix-daemon
to build the final derivation. Since evaluation can take a lot of RAM (easily on the order of a few gigabytes when evaluation a system configuration), this can cause problems if the host is memory starved an the build task is demanding.
The same issue can be mitigated by first calling nix path-info --derivation
to build a .drv
file (which does the evaluation part) and then calling nix-store --realise
on the resulting .drv
file (which does the build part). I feel like this counts as major space leak.
One way I can think of to solve this issue is to spawn a subprocess specifically for evaluation, this way the memory can be easily reclaimed by simply killing the subprocess. Not sure how hard it would be to implement though.
Expected behavior
nix build
should release unused RAM before calling nix-daemon
nix-env --version
output
nix-env (Nix) 2.18.2
Priorities
Add 👍 to issues you find important.