File tree Expand file tree Collapse file tree 2 files changed +3
-6
lines changed Expand file tree Collapse file tree 2 files changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -159,7 +159,6 @@ jobs:
159159 FLAKE_REGRESSION_GLOB : ${{ matrix.glob }}
160160 NIX_CONFIG : ${{ matrix.nix_config }}
161161 PREFETCH : " 1"
162- # GC_INITIAL_HEAP_SIZE: "32G"
163162 run : |
164163 set -x
165164 echo "PARALLEL: $PARALLEL"
Original file line number Diff line number Diff line change @@ -98,7 +98,7 @@ static inline void initGCReal()
9898 GC_set_oom_fn (oomHandler);
9999
100100 /* Set the initial heap size to something fairly big (80% of
101- free RAM, up to a maximum of 8 GiB) so that in most cases
101+ free RAM, up to a maximum of 4 GiB) so that in most cases
102102 we don't need to garbage collect at all. (Collection has a
103103 fairly significant overhead.) The heap size can be overridden
104104 through libgc's GC_INITIAL_HEAP_SIZE environment variable. We
@@ -109,12 +109,10 @@ static inline void initGCReal()
109109 if (!getEnv (" GC_INITIAL_HEAP_SIZE" )) {
110110 size_t size = 32 * 1024 * 1024 ;
111111# if HAVE_SYSCONF && defined(_SC_PAGESIZE) && defined(_SC_PHYS_PAGES)
112- size_t maxSize = 8ULL * 1024 * 1024 * 1024 ;
112+ size_t maxSize = 4ULL * 1024 * 1024 * 1024 ;
113113 auto free = getFreeMem ();
114- debug (" free memory is %d bytes" , free);
115- size = std::min ((size_t ) (free * 0.8 ), maxSize);
114+ size = std::max (size, std::min ((size_t ) (free * 0.5 ), maxSize));
116115# endif
117- debug (" setting initial heap size to %1% bytes" , size);
118116 GC_expand_hp (size);
119117 }
120118}
You can’t perform that action at this time.
0 commit comments