Re: [RFC] should physmem be cgroup-aware?

Bruno Haible via Gnulib discussion list <[email protected]>
Newsgroups gmane.comp.lib.gnulib.bugs
Message-ID <2980064.phDBveeE0g@cagnes>
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);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.