doc: add comment about highWaterMark limit
Add a comment regarding memory limits and setting highWaterMark PR-URL: https://github.com/nodejs/node/pull/33432 Reviewd-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
This commit is contained in:
parent
3abb52fdb6
commit
b51d1cfbf2
@ -93,6 +93,11 @@ A key goal of the `stream` API, particularly the [`stream.pipe()`][] method,
|
||||
is to limit the buffering of data to acceptable levels such that sources and
|
||||
destinations of differing speeds will not overwhelm the available memory.
|
||||
|
||||
The `highWaterMark` option is a threshold, not a limit: it dictates the amount
|
||||
of data that a stream buffers before it stops asking for more data. It does not
|
||||
enforce a strict memory limitation in general. Specific stream implementations
|
||||
may choose to enforce stricter limits but doing so is optional.
|
||||
|
||||
Because [`Duplex`][] and [`Transform`][] streams are both `Readable` and
|
||||
`Writable`, each maintains *two* separate internal buffers used for reading and
|
||||
writing, allowing each side to operate independently of the other while
|
||||
|
Loading…
x
Reference in New Issue
Block a user