child_process: use non-infinite maxBuffer defaults
I fixed the default behavior of maxBuffer
, because the document is written 200 * 1024
.
Currently the default maxBuffer
value is Infinity
in execSync, execFileSync and spawnSync.
Refs: https://github.com/nodejs/node/pull/22894
Set the default maxBuffer size to 204,800 bytes for execSync,
execFileSync, and spawnSync.
APIs that return the child output as a string should have non-infinite defaults
for maxBuffer sizes to avoid out-of-memory error conditions. A non-infinite
default used to be the documented behaviour for all relevant APIs, but the
implemented behaviour for execSync, execFileSync and spawnSync was
to have no maxBuffer limits.
Checklist
-
make -j4 test
(UNIX), orvcbuild test
(Windows) passes -
tests and/or benchmarks are included -
documentation is changed or added -
commit message follows commit guidelines