[Nix-dev] Why Nix-0.16 so hungry on ressources (mem + cpu) ?

Vladimír Čunát vcunat at gmail.com
Sun Oct 30 21:34:50 CET 2011


Hi.

On 26 October 2011 23:47, Paul Dufresne <dufresnep at gmail.com> wrote:
> It seems that it need to evaluate all the nix expressions in the
> unstable packages.While doing this, top reports that it eats about 72%
> of my memory (256Mb Physical + 256Mb virtual).

I'm afraid this is normal behaviour. Performance of nix evaluation
certainly isn't so good, but we seem to have much stronger machines,
so we don't mind so much (there are many other problems).

And yes, the expressions are evaluated every time, but lazily.
Installing by attribute name instead of package name helps a lot
there, because all the package names have to be evaluated to select by
package name (attribute name select directly). Here's a small test,
measuring physical memory usage (using absolute path for time to
prevent firing bash builtin):

"/var/run/current-system/sw/bin/time -f %M nix-env -i hello --dry-run"
reports using 1.3 GB RAM (!)
"/var/run/current-system/sw/bin/time -f %M nix-env -iA hello
--dry-run" reports 56 MB RAM

I'm using trunk nix, probably the same version "1.0pre29200" on
x86_64. The first number *really* seems way too much. Can anyone
explain this?

Thanks.
Vlada


More information about the nix-dev mailing list