Skip to content

Commit

Permalink
Change maximum workspace from 2GB to 3/4 of physical memory
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisJefferson committed Jun 1, 2019
1 parent 5d81b55 commit 4e14cfe
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! */
printf("Default memory size: %ld\n", SyStorMax);
#if defined(HAVE_SYSCONF)
#if defined(_SC_PAGESIZE) && defined(_SC_PHYS_PAGES)
// Set to 3/4 of memory size (in kB)
SyStorMax = (sysconf(_SC_PAGESIZE) * sysconf(_SC_PHYS_PAGES) * 3L) / 4 / 1024;
printf("Detected larger memory: %ld\n", SyStorMax);
#endif
#endif
SyAllocPool = 4096L*1024*1024; /* Note this is in bytes! */
#else
SyStorMin = 64 * 1024L;
Expand Down

0 comments on commit 4e14cfe

Please sign in to comment.