kernel: Schedule cache clears only on certain checkpoints
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
14f0c93175
commit
b52f96ab64
@ -157,10 +157,15 @@ namespace MemoryManager
|
||||
used_mem += ARCH_PAGE_SIZE;
|
||||
free_mem -= ARCH_PAGE_SIZE;
|
||||
|
||||
if (free_mem < 4 * 1024 * 1024)
|
||||
if (free_mem * 4 == total())
|
||||
{
|
||||
// Less than 4 MiB of free memory! Let's start clearing caches...
|
||||
kwarnln("Less than 4 MiB of free memory, clearing caches to try to gain extra memory");
|
||||
kwarnln("Only 1/4 of memory is free, clearing caches to try to gain extra memory");
|
||||
Scheduler::signal_oom_thread();
|
||||
}
|
||||
|
||||
if (free_mem * 8 == total())
|
||||
{
|
||||
kwarnln("Only 1/8 of memory is free, clearing caches to try to gain extra memory");
|
||||
Scheduler::signal_oom_thread();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user