On Tue, Jun 24, 2025 at 03:54:23PM +0200, Samuel Thibault wrote: > > Because that is what Linux implements: RLIMIT_AS limits what > mmap(PROT_NONE) can allocate. Then, changing with mprotect() will not > change the RLIMIT_AS counting. >
mmap(PROT_NONE)[1][2] ends up calling vm_map(cur: VM_PROT_NONE, max: VM_PROT_ALL) which is the case I'm finding trouble to test: because max is not VM_PROT_NONE it is accounted as a normal allocation. [1] https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/mach/hurd/mmap.c;hb=HEAD#l52 [2] https://sourceware.org/git/?p=glibc.git;a=blob;f=sysdeps/mach/hurd/mmap.c;hb=HEAD#l77