stream: limit number of pending writes
This avoid lots of unexpectedly small writes spams the stream and allocates lots of extra memory due to buffering memory overhead.
As each write op has a small memory overhead, lots of dispatched small writes can significantly exceed what is expected from the highWaterMark
.
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