5 ms·
There is already a hard limit, the amount of memory before the OOM killer is triggered.
by Eavolution 1y ago
There is already a hard limit, the amount of memory before the OOM killer is triggered.
- 9dev 1y agoSo why can't the limit for shell args be the amount of memory before the OOM killer is triggered as well?
- jart 1y agoIt can. Just set RLIMIT_STACK to something huge. Distros set it at 8mb by default. Take it up with them if you want the default to change for everyone.
- amelius 1y agoI mean we wouldn't even need to have this discussion if the limit was at the memory limit. Imagine having this discussion for every array in a modern system ...
- 9dev 1y agoI think I, and the parent commenter, are just pointing out how arbitrary the limit is. It can't hurt to question stuff like this every once in a while.
- jart 1y agoThere's always a limit. People only complain when it actually limits them. Most open source people have never needed to glob tens of thousands of files. If you want to feel better, POSIX says the minimum permissible ARG_MAX is 4096, and with Windows ARG_MAX is only 32767 characters.