doc: improve note on zlib APIs threadpool usage

Raise awareness against the catastrophic memory fragmentation that can
be created while using the asynchronous zlib APIs.

PR-URL: https://github.com/nodejs/node/pull/20380
Refs: https://github.com/nodejs/node/issues/8871
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
This commit is contained in:
Luigi Pinca 2018-04-28 13:00:04 +02:00 committed by Anatoli Papirovski
parent c1a87a30e7
commit 0234068f7f
No known key found for this signature in database
GPG Key ID: 614E2E1ABEB4B2C0

View File

@ -48,9 +48,9 @@ zlib.unzip(buffer, (err, buffer) => {
## Threadpool Usage ## Threadpool Usage
Note that all zlib APIs except those that are explicitly synchronous use libuv's Note that all zlib APIs except those that are explicitly synchronous use libuv's
threadpool, which can have surprising and negative performance implications for threadpool. This can lead to surprising effects in some applications, such as
some applications, see the [`UV_THREADPOOL_SIZE`][] documentation for more subpar performance (which can be mitigated by adjusting the [pool size][])
information. and/or unrecoverable and catastrophic memory fragmentation.
## Compressing HTTP requests and responses ## Compressing HTTP requests and responses
@ -777,9 +777,9 @@ Decompress a chunk of data with [`Unzip`][].
[`Inflate`]: #zlib_class_zlib_inflate [`Inflate`]: #zlib_class_zlib_inflate
[`InflateRaw`]: #zlib_class_zlib_inflateraw [`InflateRaw`]: #zlib_class_zlib_inflateraw
[`TypedArray`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray [`TypedArray`]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray
[`UV_THREADPOOL_SIZE`]: cli.html#cli_uv_threadpool_size_size
[`Unzip`]: #zlib_class_zlib_unzip [`Unzip`]: #zlib_class_zlib_unzip
[`options`]: #zlib_class_options [`options`]: #zlib_class_options
[`zlib.bytesWritten`]: #zlib_zlib_byteswritten [`zlib.bytesWritten`]: #zlib_zlib_byteswritten
[Memory Usage Tuning]: #zlib_memory_usage_tuning [Memory Usage Tuning]: #zlib_memory_usage_tuning
[pool size]: cli.html#cli_uv_threadpool_size_size
[zlib documentation]: https://zlib.net/manual.html#Constants [zlib documentation]: https://zlib.net/manual.html#Constants