world loading memory pressure detector

Signed-off-by: Pavel Okhlopkov <pavel.okhlopkov@flant.com>
This commit is contained in:
Pavel Okhlopkov 2026-04-06 21:05:20 +03:00
parent 4b9b3026f4
commit 312994be83
4 changed files with 42 additions and 1 deletions

View file

@ -126,5 +126,12 @@ bool MemoryMonitor::isMemoryPressure() const {
return available < (totalRAM_ * 10 / 100);
}
bool MemoryMonitor::isSevereMemoryPressure() const {
size_t available = getAvailableRAM();
// Severe pressure if < 15% RAM available — background workers should
// pause entirely to avoid OOM-killing other applications.
return available < (totalRAM_ * 15 / 100);
}
} // namespace core
} // namespace wowee