Skip to content

Commit

Permalink
Change maximum workspace to largest of 2GB and 3/4 of physical memory
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisJefferson committed Jun 5, 2019
1 parent 97e73d6 commit cf43990
Showing 1 changed file with 8 additions and 0 deletions.
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

0 comments on commit cf43990

Please sign in to comment.