Skip to content

Commit 72a857f

Browse files
Flarnaruyadorno
authored andcommitted
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: #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 7aeaa27 commit 72a857f

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');
@@ -286,6 +293,13 @@ A heap snapshot is specific to a single V8 isolate. When using
286293
[worker threads][], a heap snapshot generated from the main thread will
287294
not contain any information about the workers, and vice versa.
288295

296+
Creating a heap snapshot requires memory about twice the size of the heap at
297+
the time the snapshot is created. This results in the risk of OOM killers
298+
terminating the process.
299+
300+
Generating a snapshot is a synchronous operation which blocks the event loop
301+
for a duration depending on the heap size.
302+
289303
```js
290304
const { writeHeapSnapshot } = require('v8');
291305
const {

0 commit comments

Comments
 (0)