1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-08 19:46:02 +01:00

Increase the initial Boehm GC mark stack size

If the mark stack size is too small, it greatly inhibits parallel
marking, which is very bad for performance on multi-core systems.
This commit is contained in:
Eelco Dolstra 2025-08-04 21:07:26 +02:00
parent 4c1c4f79a3
commit 0d559f0c13

View file

@ -50,9 +50,19 @@ scope: {
requiredSystemFeatures = [ ];
};
boehmgc = pkgs.boehmgc.override {
enableLargeConfig = true;
};
boehmgc =
(pkgs.boehmgc.override {
enableLargeConfig = true;
}).overrideAttrs
(attrs: {
# Increase the initial mark stack size to avoid stack
# overflows, since these inhibit parallel marking (see
# GC_mark_some()). To check whether the mark stack is too
# small, run Nix with GC_PRINT_STATS=1 and look for messages
# such as `Mark stack overflow`, `No room to copy back mark
# stack`, and `Grew mark stack to ... frames`.
NIX_CFLAGS_COMPILE = "-DINITIAL_MARK_STACK_SIZE=1048576";
});
# TODO Hack until https://github.com/NixOS/nixpkgs/issues/45462 is fixed.
boost =