Andy-Python-Programmer/aero

Purgeable Kernel Memory

Andy-Python-Programmer opened this issue · 1 comments

We could have the concept of purgeable kernel memory that we can purge at any moment if we get out of memory. This way we could have a PurgeableOnce which will destroy and free its inner storage on OOM and that way we could get by using a lot less memory. Using this mechanism we could update all of the CACHES to use PurgeableOnce rather then just Once to store the inner data. This method can also be applied to userland memory mappings but we will prioritise purgeable kernel memory first since there are a lot of stuff that kernel caches and can be freed on OOM.

:^) big brain 🧠 :^)

Nice one.

SerenityOS has a proper implementation of this that is similar to macOS'.

https://www.reddit.com/r/programming/comments/e8pbmk/implementing_macosstyle_purgeable_memory_in_my/