mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-04-15 08:53: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
|
|
@ -34,10 +34,17 @@ public:
|
|||
size_t getRecommendedCacheBudget() const;
|
||||
|
||||
/**
|
||||
* Check if system is under memory pressure
|
||||
* Check if system is under memory pressure (< 10% RAM available)
|
||||
*/
|
||||
bool isMemoryPressure() const;
|
||||
|
||||
/**
|
||||
* Check if system is under severe memory pressure (< 15% RAM available).
|
||||
* At this level, background loading should pause entirely until memory
|
||||
* is freed — continuing to allocate risks OOM-killing other applications.
|
||||
*/
|
||||
bool isSevereMemoryPressure() const;
|
||||
|
||||
private:
|
||||
MemoryMonitor() = default;
|
||||
size_t totalRAM_ = 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue