Skip to content

Commit

Permalink
feat(xsnap): increase allocation limit to 2GB
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
dckc authored and kriskowal committed May 4, 2021
1 parent 10940f9 commit 5922cbd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
10 changes: 7 additions & 3 deletions packages/xsnap/src/xsnap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions packages/xsnap/src/xsnap.h
Original file line number Diff line number Diff line change
Expand Up @@ -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; \
Expand Down

0 comments on commit 5922cbd

Please sign in to comment.