From d8e68e16c0163ff798d5408137617cb4430ea4b9 Mon Sep 17 00:00:00 2001 From: Dan Connolly Date: Mon, 3 May 2021 18:22:27 -0500 Subject: [PATCH] feat(xsnap): increase allocation limit to 2GB The allocationLimit was previously set to 10 times the amount of memory that the vats use on start-up. Until things like kernel GC are more in place, let's expand to 2GB. --- packages/xsnap/src/xsnap.c | 10 +++++++--- packages/xsnap/src/xsnap.h | 4 ++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/packages/xsnap/src/xsnap.c b/packages/xsnap/src/xsnap.c index aa076ff35f2d..277bec2c213e 100644 --- a/packages/xsnap/src/xsnap.c +++ b/packages/xsnap/src/xsnap.c @@ -1083,11 +1083,15 @@ void fxCreateMachinePlatform(txMachine* the) the->promiseJobs = 0; the->timerJobs = NULL; + // Original 10x strategy: // SLOGFILE=out.slog agoric start local-chain // jq -s '.|.[]|.dr[2].allocate' < out.slog|grep -v null|sort -u | sort -nr - int MB = 1024 * 1024; - int measured_max = 30 * MB; - the->allocationLimit = 10 * measured_max; + // int MB = 1024 * 1024; + // int measured_max = 30 * MB; + // the->allocationLimit = 10 * measured_max; + + size_t GB = 1024 * 1024 * 1024; + the->allocationLimit = 2 * GB; } void fxDeleteMachinePlatform(txMachine* the) diff --git a/packages/xsnap/src/xsnap.h b/packages/xsnap/src/xsnap.h index 445781c2e302..be95b6dc6cdd 100644 --- a/packages/xsnap/src/xsnap.h +++ b/packages/xsnap/src/xsnap.h @@ -67,8 +67,8 @@ #endif #define mxMachinePlatform \ txSocket connection; \ - txSize allocationLimit; \ - txSize allocatedSpace; \ + size_t allocationLimit; \ + size_t allocatedSpace; \ txUnsigned allocateChunksCallCount; \ txUnsigned allocateSlotsCallCount; \ txUnsigned garbageCollectionCount; \