Skip to content

Commit e2484b2

Browse files
benjamingrtargos
authored andcommittedJun 2, 2020
doc: add comment about highWaterMark limit
Add a comment regarding memory limits and setting highWaterMark PR-URL: #33432 Reviewd-By: Colin Ihrig <[email protected]> Reviewed-By: Robert Nagy <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Ruben Bridgewater <[email protected]>
1 parent 8d47e8b commit e2484b2

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed
 

‎doc/api/stream.md

+5
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,11 @@ A key goal of the `stream` API, particularly the [`stream.pipe()`][] method,
9393
is to limit the buffering of data to acceptable levels such that sources and
9494
destinations of differing speeds will not overwhelm the available memory.
9595

96+
The `highWaterMark` option is a threshold, not a limit: it dictates the amount
97+
of data that a stream buffers before it stops asking for more data. It does not
98+
enforce a strict memory limitation in general. Specific stream implementations
99+
may choose to enforce stricter limits but doing so is optional.
100+
96101
Because [`Duplex`][] and [`Transform`][] streams are both `Readable` and
97102
`Writable`, each maintains *two* separate internal buffers used for reading and
98103
writing, allowing each side to operate independently of the other while

0 commit comments

Comments
 (0)