Since the containers are not the only means that can restrict the available memory for a program, let me document that:
2026-08-20 Bruno Haible <[email protected]> physmem: Clarify relation with getrlimit(). * lib/physmem.h: Add a comment. diff --git a/lib/physmem.h b/lib/physmem.h index 7b2e35c997..d3b19bab87 100644 --- a/lib/physmem.h +++ b/lib/physmem.h @@ -25,6 +25,11 @@ extern "C" { #endif +/* Note: These functions do not consider the configurable resource limits + (RLIMIT_DATA, RLIMIT_AS, RLIMIT_RSS). If you want to consider them, + you need to do so separately, via getrlimit(). */ + + /* Returns the total amount of physical memory. This value is more or less a hard limit for the working set. */ double physmem_total (void);
