mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-04-27 13:33:51 +00:00
world loading memory pressure detector
Signed-off-by: Pavel Okhlopkov <pavel.okhlopkov@flant.com>
This commit is contained in:
parent
4b9b3026f4
commit
312994be83
4 changed files with 42 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue