3 ms·
This will attempt to open a child shell process with whatever output of "yes" is, interpreted as shell script. But before that, parent shell has to buffer unti
by aexaey 9y ago
This will attempt to open a child shell process with whatever output of "yes" is, interpreted as shell script.
But before that, parent shell has to buffer until EOF. With "yes" output being unbound, this means unbound buffering / memory growth. That is, until OOM killer take notice and shut it down.
Whole thing will probably take few seconds to a minute (depending on how much free RAM there is vs. how fast it is), peg a single CPU core in the process, and will recover cleanly (except for shell in question being terminated).
...unless system in question has single CPU and large+slow swap. Then yes, bring-it-to-its-knees.
- marcosdumay 9y agoIt may also push everything in memory to swap in the process, what is the real speed killer.
- AstralStorm 9y agoMake sure to have a sane memory limit set in PAM and switch vm.swappiness to lower value than 60.
- AstralStorm 9y agoSingle CPU is fine nowadays. It will be slowish if you ran it with no nice or priority. RAM can be tweaked by preventing Linux heuristic overcommit via sysctl vm.overcommit_memory=2. (0 is only recommended if you do not run broken applications. It so happens that many JS and Java VMs are broken on memory pressure.)