MCPcopy Create free account
hub / github.com/apple/foundationdb / startMemoryUsageMonitor

Function startMemoryUsageMonitor

flow/SystemMonitor.cpp:419–429  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

417}
418
419Future<Void> startMemoryUsageMonitor(uint64_t memLimit) {
420 if (memLimit == 0) {
421 return Void();
422 }
423 auto checkMemoryUsage = [=]() {
424 if (getResidentMemoryUsage() > memLimit) {
425 platform::outOfMemory();
426 }
427 };
428 return recurring(checkMemoryUsage, FLOW_KNOBS->MEMORY_USAGE_CHECK_INTERVAL);
429}

Callers 3

mainFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85

Calls 3

getResidentMemoryUsageFunction · 0.85
outOfMemoryFunction · 0.85
VoidClass · 0.70

Tested by

no test coverage detected