NixOS / nix

Nix, the purely functional package manager
https://nixos.org/
GNU Lesser General Public License v2.1
12.73k stars 1.52k forks source link

nix-env beginner problem: can't run on AWS t2.micro EC2 node #2536

Open rgeary1 opened 5 years ago

rgeary1 commented 5 years ago

Most tutorials on nix start with "nix-env -qa". However if you run this on a standard AWS free-tier t2.micro node it runs out of memory and kills the machine. "unable to fork: Cannot allocate memory"... When the node dies, it requires a hard reboot.

This type of issue has been reported before (https://github.com/NixOS/nix/issues/421 https://github.com/NixOS/nixpkgs/issues/12019) but does not specifically address the issue from the perspective of new Nix users like me.

Is there a hard technical reason why "nix-env -qa" requires more than 500Mb of RAM? Or is it possible to significantly improve the memory consumption?

Maybe it is possible to modify nix-env to detect that you are running low on RAM and terminate itself before it kills the machine?

If "nix-env -qA " is considered the right way to query, why not reach out to tutorial writers?

stale[bot] commented 3 years ago

I marked this as stale due to inactivity. → More info

stale[bot] commented 2 years ago

I closed this issue due to inactivity. → More info

vimkim commented 10 months ago

Still having this problem