aero icon indicating copy to clipboard operation
aero copied to clipboard

Purgeable Kernel Memory

Open Andy-Python-Programmer opened this issue 2 years ago • 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 🧠 :^)

Andy-Python-Programmer avatar Feb 02 '22 00:02 Andy-Python-Programmer

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/

markusbkk avatar Dec 03 '23 11:12 markusbkk