Verify that we have enough memory if cache_memory is set

This commit is contained in:
mpilman 2019-09-13 12:54:37 -07:00
parent 6d47c686df
commit 8c1c0296ed
1 changed files with 5 additions and 0 deletions

View File

@ -1488,6 +1488,11 @@ int main(int argc, char* argv[]) {
// evictionPolicyStringToEnum will throw an exception if the string is not recognized as a valid
EvictablePageCache::evictionPolicyStringToEnum(flowKnobs->CACHE_EVICTION_POLICY);
if (memLimit < FLOW_KNOBS->PAGE_CACHE_4K + (2LL<<30)) {
fprintf(stderr, "ERROR: --memory has to be at least 2GiB larger than --cache_memory\n");
flushAndExit(FDB_EXIT_ERROR);
}
if (role == SkipListTest) {
skipListTest();
flushAndExit(FDB_EXIT_SUCCESS);