From 1bdb138710344d230635032be9648b6202f82e78 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Wed, 4 Jul 2018 16:19:25 +0200 Subject: [PATCH] nix: use boehmgc with enableLargeConfig = true Fixes #43015 for me and hopefully also similar issues. == Resource consumption == TL;DR: no change for small-memory cases, less CPU for large-memory cases. I assume almost all of the large memory usage is just the expression evaluation and managed by the GC, so I used just `nix-env -q...` to test. Old and new lines for each command follow. I tried to run each several times, but the values were very stable (<1% difference on re-runs), so only one line for each command-version pair is provided. $ time nix-env -f . -qaP --description -A nix >/dev/null - 0.06user 0.01system 0:00.07elapsed 101%CPU (0avgtext+0avgdata 29036maxresident)k + 0.06user 0.01system 0:00.07elapsed 102%CPU (0avgtext+0avgdata 29864maxresident)k $ time nix-env -f . -qaP --description >/dev/null - 6.45user 0.36system 0:06.82elapsed 99%CPU (0avgtext+0avgdata 1021024maxresident)k + 6.23user 0.33system 0:06.57elapsed 100%CPU (0avgtext+0avgdata 938408maxresident)k $ time nix-env -f . --show-trace -qa --drv-path --system --meta --xml 2>&1 >/dev/null - 56.35user 0.96system 0:31.03elapsed 184%CPU (0avgtext+0avgdata 3207708maxresident)k + 44.80user 0.91system 0:26.12elapsed 175%CPU (0avgtext+0avgdata 3192696maxresident)k $ time ./result-nix-large/bin/nix-instantiate --dry-run --eval --strict \ --show-trace ./maintainers/scripts/eval-release.nix > /dev/null - Too many heap sections: Increase MAXHINCR or MAX_HEAP_SECTS - Command terminated by signal 6 - 175.18user 2.68system 1:17.42elapsed 229%CPU (0avgtext+0avgdata 8468440maxresident)k + 178.48user 2.78system 1:15.11elapsed 241%CPU (0avgtext+0avgdata 8460572maxresident)k --- pkgs/development/libraries/boehm-gc/default.nix | 3 ++- pkgs/top-level/all-packages.nix | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/pkgs/development/libraries/boehm-gc/default.nix b/pkgs/development/libraries/boehm-gc/default.nix index f33ee8623580..c11d6689624d 100644 --- a/pkgs/development/libraries/boehm-gc/default.nix +++ b/pkgs/development/libraries/boehm-gc/default.nix @@ -1,4 +1,5 @@ -{ lib, stdenv, fetchurl, fetchpatch, pkgconfig, libatomic_ops, enableLargeConfig ? false +{ lib, stdenv, fetchurl, fetchpatch, pkgconfig, libatomic_ops +, enableLargeConfig ? false # doc: https://github.com/ivmai/bdwgc/blob/v7.6.6/doc/README.macros#L179 , buildPlatform, hostPlatform }: diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index f18ac8f222d9..9d52427ca59f 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -21138,6 +21138,7 @@ with pkgs; storeDir = config.nix.storeDir or "/nix/store"; stateDir = config.nix.stateDir or "/nix/var"; curl = curl_7_59; + boehmgc = boehmgc.override { enableLargeConfig = true; }; }) nix nix1