From 97e73d65b7b10fc54bb81641fee23ec1deb1cd62 Mon Sep 17 00:00:00 2001 From: Chris Jefferson Date: Sat, 1 Jun 2019 22:25:27 +0100 Subject: [PATCH 1/2] Set memory limits on testspecial tests This is required to let GAP dynamically calculate these values, based on the user's physical memory --- tst/testspecial/run_gap.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tst/testspecial/run_gap.sh b/tst/testspecial/run_gap.sh index 7249ac4c03..16d7848e9e 100755 --- a/tst/testspecial/run_gap.sh +++ b/tst/testspecial/run_gap.sh @@ -12,8 +12,9 @@ gfile="$2" # 2) Combine stderr and stdout # 3) Rewrite the root of gap with the string GAPROOT, # so the output is usable on other machines +# 4) Set lower and upper memory limits, for consistency GAPROOT=$(cd ../..; pwd) ( echo "LogTo(\"${outfile}.tmp\");" ; cat "$gfile" ; echo "QUIT;" ) | - "$gap" -r -A -b -x 800 2>/dev/null >/dev/null + "$gap" -r -A -b -m 256m -o 512m -x 800 2>/dev/null >/dev/null sed "s:${GAPROOT//:/\\:}:GAPROOT:g" < "${outfile}.tmp" rm "${outfile}.tmp" From cf43990f5e2b2ce83049c18f650ab095f16be6d0 Mon Sep 17 00:00:00 2001 From: Chris Jefferson Date: Sat, 1 Jun 2019 19:58:50 +0100 Subject: [PATCH 2/2] Change maximum workspace to largest of 2GB and 3/4 of physical memory --- src/system.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/system.c b/src/system.c index 475f1d6f41..2a26390378 100644 --- a/src/system.c +++ b/src/system.c @@ -1063,6 +1063,14 @@ void InitSystem ( #ifdef SYS_IS_64_BIT SyStorMin = 128 * 1024L; SyStorMax = 2048*1024L; /* This is in kB! */ +#if defined(HAVE_SYSCONF) +#if defined(_SC_PAGESIZE) && defined(_SC_PHYS_PAGES) + // Set to 3/4 of memory size (in kB), if this is larger + Int SyStorMaxFromMem = + (sysconf(_SC_PAGESIZE) * sysconf(_SC_PHYS_PAGES) * 3L) / 4 / 1024; + SyStorMax = SyStorMaxFromMem > SyStorMax ? SyStorMaxFromMem : SyStorMax; +#endif +#endif SyAllocPool = 4096L*1024*1024; /* Note this is in bytes! */ #else SyStorMin = 64 * 1024L;