25 Jan
2023
25 Jan
'23
14:17
On 1/25/23 15:08, Jan Engelhardt wrote:
But if it only uses a few bytes, then the -d limit should not normally be reached assuming standard overcommit (or should it?); rather, the -v limit would be relevant.
The -v is for the entire address space, code, stack and data segments. The -d only for the data segment bits. But in both cases, this is about address space and not actually committed data. You can try it yourself with, #include <stdio.h> #include <stdlib.h> int main() { printf("%p\n", malloc(1e9)); return 0; } and set `ulimit -d 100000` and it will print a nice null for you :-) - Adam