diff options
author | Gerhard Stöbich <deb2001-github@yahoo.de> | 2022-02-04 22:16:41 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-04 22:16:41 +0300 |
commit | 9e892e22e36c1186ff11cb050c33e5945c52c99d (patch) | |
tree | cc36de8d2ce51f0bb3074f830b844ada1aebcf63 /doc | |
parent | f069793fd4feef1ecb02280f30e07e0979e26fbb (diff) |
doc: add overhead hints for heap snapshot generation
Added some hints that creation of an heap snapshot has significant
overhead on memory requirement and event loop utilization.
PR-URL: https://github.com/nodejs/node/pull/41822
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Diffstat (limited to 'doc')
-rw-r--r-- | doc/api/v8.md | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/doc/api/v8.md b/doc/api/v8.md index 0359b20396f..56e01938c5b 100644 --- a/doc/api/v8.md +++ b/doc/api/v8.md @@ -71,6 +71,13 @@ This JSON stream format is intended to be used with tools such as Chrome DevTools. The JSON schema is undocumented and specific to the V8 engine. Therefore, the schema may change from one version of V8 to the next. +Creating a heap snapshot requires memory about twice the size of the heap at +the time the snapshot is created. This results in the risk of OOM killers +terminating the process. + +Generating a snapshot is a synchronous operation which blocks the event loop +for a duration depending on the heap size. + ```js // Print heap snapshot to the console const v8 = require('v8'); @@ -290,6 +297,13 @@ A heap snapshot is specific to a single V8 isolate. When using [worker threads][], a heap snapshot generated from the main thread will not contain any information about the workers, and vice versa. +Creating a heap snapshot requires memory about twice the size of the heap at +the time the snapshot is created. This results in the risk of OOM killers +terminating the process. + +Generating a snapshot is a synchronous operation which blocks the event loop +for a duration depending on the heap size. + ```js const { writeHeapSnapshot } = require('v8'); const { |