Jan Wieck <jan@wi3ck.info> writes:
> On 5/17/22 15:42, Stephen Frost wrote:
>> Thoughts?
> Using cgroups one can actually force a certain process (or user, or
> service) to use swap if and when that service is using more memory than
> it was "expected" to use.
I wonder if we shouldn't just provide documentation pointing to OS-level
facilities like that one. The kernel has a pretty trivial way to check
the total memory used by a process. We don't: it'd require tracking total
space used in all our memory contexts, and then extracting some number out
of our rear ends for allocations made directly from malloc. In short,
anything we do here will be slow and unreliable, unless you want to depend
on platform-specific things like looking at /proc/self/maps.
ulimit might be interesting to check into as well. The last time I
looked, it wasn't too helpful for this on Linux, but that was years ago.
regards, tom lane