Out-of-memory victim selection with BPF
Out-of-memory victim selection with BPF
Posted Aug 18, 2023 8:36 UTC (Fri) by eduperez (guest, #11232)In reply to: Out-of-memory victim selection with BPF by rrolls
Parent article: Out-of-memory victim selection with BPF
I do not think that the main argument in favor of overcommit are those programs that cannot handle a "no" from malloc; returning a valid pointer, to a memory that cannot be used because there is no more memory available, is just delaying the problem. Besides, that situation should be easy to take into account by the program, in most cases.
The main argument in favor of overcommit are those programs that allocate far more memory than they really need, because (in some use cases) it is easier to allocate a large memory block, and only use some parts of it, rather than allocate multiple smaller memory blocks. With overcommit, the kernel can delay the allocation until the program really uses each block; in many cases, most of that memory will never have to be allocated at all, and can be used by other programs.
In general, OOM kicks in when a program uses a memory block, not during the malloc.
Posted Aug 25, 2023 4:18 UTC (Fri)
by ssmith32 (subscriber, #72404)
[Link]
So, they try to play games to work around the actual memory allocator(s), blissfully ignorant of the fact they've accomplished exactly zero, and the actual memory allocator just effectively ignores their requests, and goes ahead and allocates when it decides is best.
Seems odd that we should worry about that scenario, but I can see why it happens, from both sides. E.g. Java programs working around the GC, which is on top of the userspace allocator, which is on top of the kernel allocator. They'd be better off with not Java, or understanding and configuring the many layers beneath them.
Out-of-memory victim selection with BPF