Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nix tests can't run in a system with 512MiB of RAM #84

Closed
viric opened this issue Jan 2, 2013 · 6 comments
Closed

Nix tests can't run in a system with 512MiB of RAM #84

viric opened this issue Jan 2, 2013 · 6 comments

Comments

@viric
Copy link
Member

viric commented Jan 2, 2013

Even having 100MiB of swap, the tests fail due to not being able to run 'xz -9' in corepkgs/nar.nix

# xz -9 > /dev/null 
xz: (stdin): Cannot allocate memory
# free
             total       used       free     shared    buffers     cached
Mem:        448744     265720     183024          0      23812     193500
-/+ buffers/cache:      48408     400336
Swap:       102396      50244      52152

As for nixpkgs, it makes the building of nix fail.

@viric
Copy link
Member Author

viric commented Jan 2, 2013

'xz' alone runs fine.

@edolstra
Copy link
Member

edolstra commented Jan 2, 2013

Yes, "xz -9" uses a lot of memory. Maybe add more swap?

@viric
Copy link
Member Author

viric commented Jan 2, 2013

Well, we all know that solution :) My concern was more about it being a big requirement, for the package manager tests.
Of all NixOS pieces, only nix (its tests) requires that amount of memory.

@viric
Copy link
Member Author

viric commented Mar 31, 2013

My solution has been, both in the raspberry pi and the sheevaplug, to use:

nixpkgs.config.packageOverrides = p: {
      nix = p.lib.overrideDerivation p.nix (attrs: {
        patchPhase = "sed -i s/-9// corepkgs/nar.nix";
        });
      nixUnstable = p.lib.overrideDerivation p.nixUnstable (attrs: {
        patchPhase = "sed -i s/-9// corepkgs/nar.nix";
        });
  };
}

@bjornfor
Copy link
Contributor

+1 for reducing the memory footprint. (Why does a test need to use more memory than the actual system?)

Interesting, "man xz" actually has lots of info about memory usage and ways to limit it. Search for memory or memlimit.

@edolstra
Copy link
Member

But the "actual system" does use this much memory because it (nix-push) calls "xz -9".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants