-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
OOM during flake check on nix >= 2.10 #7698
Comments
Will recheck once #7811 is in |
And now is it improved or I need to find more leaks ? |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: |
I was just playing around with the example in that discourse post: {
inputs.nixpkgs.url = "github:nixos/nixpkgs?rev=c374d94f1536013ca8e92341b540eba4c22f9c62";
outputs = {
self,
nixpkgs,
}: let
# pkgsSet is written in a way that it also works as a non-flake
# default.nix without modifications, issue persists in non flake context
pkgsSet = {
nixpkgs ? <nixpkgs>,
localSystem ? builtins.currentSystem,
}: let
# ensure we're cross compiling
crossSystem = {
"x86_64-linux" = "aarch64-linux";
"aarch64-linux" = "x86_64-linux";
}.${localSystem};
pkgs = import nixpkgs {
system = localSystem;
};
pkgsCross = import nixpkgs {
inherit crossSystem localSystem;
};
mkLargePython = pkgs:
pkgs.python3.withPackages (ps:
builtins.attrValues {
inherit (ps) numpy matplotlib requests pandas;
});
in {
python = mkLargePython pkgs; # native, no problem
hello = pkgsCross.hello; # small cross, no problem
pythonCross = mkLargePython pkgsCross; # big cross, ooms during evaluation
};
in {
packages = nixpkgs.lib.genAttrs ["x86_64-linux" "aarch64-linux"] (system:
pkgsSet {
inherit nixpkgs;
localSystem = system;
});
};
} It doesn't OOM on my machine (32GB of RAM) but here are some results: [jkolb@nixos:~/eval-bomb]$ command time -v nix eval --no-eval-cache .#python
warning: Git tree '/home/jkolb/eval-bomb' is dirty
«derivation /nix/store/ygx8zgvj0p7j4d64jpqi15sgq5lbxx9v-python3-3.12.4-env.drv»
Command being timed: "nix eval --no-eval-cache .#python"
User time (seconds): 0.95
System time (seconds): 0.42
Percent of CPU this job got: 74%
Elapsed (wall clock) time (h:mm:ss or m:ss): 0:01.84
Average shared text size (kbytes): 0
Average unshared data size (kbytes): 0
Average stack size (kbytes): 0
Average total size (kbytes): 0
Maximum resident set size (kbytes): 238076
Average resident set size (kbytes): 0
Major (requiring I/O) page faults: 0
Minor (reclaiming a frame) page faults: 55519
Voluntary context switches: 5633
Involuntary context switches: 50
Swaps: 0
File system inputs: 0
File system outputs: 0
Socket messages sent: 0
Socket messages received: 0
Signals delivered: 0
Page size (bytes): 4096
Exit status: 0 [jkolb@nixos:~/eval-bomb]$ command time -v nix eval --no-eval-cache .#pythonCross
warning: Git tree '/home/jkolb/eval-bomb' is dirty
«derivation /nix/store/2aklmw7wb84pjl4bg2llnnzn4hklyqll-python3-aarch64-unknown-linux-gnu-3.12.4-env.drv»
Command being timed: "nix eval --no-eval-cache .#pythonCross"
User time (seconds): 18.14
System time (seconds): 3.76
Percent of CPU this job got: 92%
Elapsed (wall clock) time (h:mm:ss or m:ss): 0:23.77
Average shared text size (kbytes): 0
Average unshared data size (kbytes): 0
Average stack size (kbytes): 0
Average total size (kbytes): 0
Maximum resident set size (kbytes): 7624692
Average resident set size (kbytes): 0
Major (requiring I/O) page faults: 0
Minor (reclaiming a frame) page faults: 1902293
Voluntary context switches: 19729
Involuntary context switches: 778
Swaps: 0
File system inputs: 0
File system outputs: 0
Socket messages sent: 0
Socket messages received: 0
Signals delivered: 0
Page size (bytes): 4096
Exit status: 0 The memory/time differences are pretty dramatic.
|
If it's actually cross-compiling that causes your slow down, I would be surprised this actually significantly got slowed down in new nix versions. Do you have a before/after for that using different nix version? Especially memory usage. I think this is rather an architectural problem in nixpkgs than an issue nix can solve easily. |
This is just eval. It didn't appear to be cross compiling anything but I can check on Monday. |
@Mic92 there doesn't appear to be any cross-compilation going on according to htop. If I |
I mean evaluation for cross compiled packages is just slow because of architectural issues in nixpkgs because it needs to evaluate derivations for different targets. |
That makes some sense to me but the discrepancy is just massive. Should I file a bug with nixpkgs? |
@Mic92 I filed the bug NixOS/nixpkgs#338231 |
Describe the bug
I have a flake (unfortunately proprietary) that has a lot of modules. Unfortunately
nix flake check
OOMs on nix >= 2.10 by wanting over 16GB of memory.nix flake check -vvv
ends with the following before dying:Is there any information I can get to help debug this?
Expected behavior
nix flake check
succeeds.**nix-env (Nix) 2.13.1
**
Additional context
Add any other context about the problem here.
Priorities
Add 👍 to issues you find important.
The text was updated successfully, but these errors were encountered: