Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

doc: add overhead hints for heap snapshot generation #41822

Merged
merged 1 commit into from
Feb 4, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions doc/api/v8.md
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -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 {
Expand Down