|
|
Log in / Subscribe / Register

Out-of-memory victim selection with BPF

Out-of-memory victim selection with BPF

Posted Aug 18, 2023 12:47 UTC (Fri) by Sesse (subscriber, #53779)
In reply to: Out-of-memory victim selection with BPF by WolfWings
Parent article: Out-of-memory victim selection with BPF

That “large enough” swap can easily go into hundreds of gigabytes for a pretty normal server, though. Anything that forks (e.g. Apache) eats into the overcommit space really fast.


to post comments

Out-of-memory victim selection with BPF

Posted Aug 22, 2023 10:17 UTC (Tue) by WolfWings (subscriber, #56790) [Link]

"Large enough" hasn't been "RAM * 1.5" for years if not decades at this point. Any articles claiming that are cargo-culting a recommendation from many years ago when 1GB was a lot of RAM, much like generating CSRs with SNI records in OpenSSL haven't needed custom .cnf files for a very long time now but many tutorials still go that route.

Even MS starts at "RAM / 8, max 32GB" for their page file size recommended minimum. So beyond 256GB of RAM the baseline swap space doesn't go up any further. And even if you leave it on auto it will upper-limit it to 1/8th of the system volume size, and quite often large servers such as you're describing will have a separate boot volume of say a pair of RAID-1 480GB drives in my experience and the main data on separate volumes, so that puts a hard cap of 60GB virtual memory even if the server has over a terabyte of RAM.

https://learn.microsoft.com/en-us/troubleshoot/windows-cl...

The only time 'full RAM' sizes figure into things is if you expect and want to capture a full memory dump for either crash debugging or uncompressed hibernation. Even Ubuntu recommends (and I quote) round(sqrt(RAM)) so 1TB = 32G of swap... hey there's that number again.

https://help.ubuntu.com/community/SwapFaq

And disabling overcommit doesn't mean an allocation is instantly faulted in and removed from page cache. That's two separate things. Disabling overcommit just prevents the kernel from offering more pages than exist on the system, but doesn't change how those pages are actually managed. Copy-on-write still applies, etc.


Copyright © 2026, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds