Skip to content

Commit 9e892e2

Browse files
authored
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: nodejs#41822 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
1 parent f069793 commit 9e892e2

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

doc/api/v8.md

+14
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,13 @@ This JSON stream format is intended to be used with tools such as
7171
Chrome DevTools. The JSON schema is undocumented and specific to the
7272
V8 engine. Therefore, the schema may change from one version of V8 to the next.
7373

74+
Creating a heap snapshot requires memory about twice the size of the heap at
75+
the time the snapshot is created. This results in the risk of OOM killers
76+
terminating the process.
77+
78+
Generating a snapshot is a synchronous operation which blocks the event loop
79+
for a duration depending on the heap size.
80+
7481
```js
7582
// Print heap snapshot to the console
7683
const v8 = require('v8');
@@ -290,6 +297,13 @@ A heap snapshot is specific to a single V8 isolate. When using
290297
[worker threads][], a heap snapshot generated from the main thread will
291298
not contain any information about the workers, and vice versa.
292299

300+
Creating a heap snapshot requires memory about twice the size of the heap at
301+
the time the snapshot is created. This results in the risk of OOM killers
302+
terminating the process.
303+
304+
Generating a snapshot is a synchronous operation which blocks the event loop
305+
for a duration depending on the heap size.
306+
293307
```js
294308
const { writeHeapSnapshot } = require('v8');
295309
const {

0 commit comments

Comments
 (0)