Skip to content
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

Switch from 2GB memory space to 3/4 of physical memory #3483

Merged
merged 2 commits into from
Jun 14, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/system.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 2 additions & 1 deletion tst/testspecial/run_gap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"