Somehow the included script causes a memory leak. Memory usage will
grow huge over a very short timeframe.
The script is pointless, but cut down from a larger one that does
something useful.
Originally, the subshell was reading a while (cat ...), so the printf
loop has nothing to do with it.
Replacing the call to f2() with an echo, or anything not a function
call, makes it not leak.
Repeat-By:
f2() { return 1; }
f1()
{
while read -r line; do
f2 "test"
done < <(
for ((i=0;i<1000000000;i++)); do
printf '%s\n' "$i"
done
)
}
f1