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: revise v8.getHeapSnapshot() #35849

Merged
merged 1 commit into from
Nov 6, 2020
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
40 changes: 20 additions & 20 deletions doc/api/v8.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,26 @@ v8.setFlagsFromString('--allow_natives_syntax');
console.log(v8.cachedDataVersionTag()); // 183726201
```

## `v8.getHeapSnapshot()`
<!-- YAML
added: v11.13.0
-->

* Returns: {stream.Readable} A Readable Stream containing the V8 heap snapshot

Generates a snapshot of the current V8 heap and returns a Readable
Stream that may be used to read the JSON serialized representation.
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.

```js
// Print heap snapshot to the console
const v8 = require('v8');
const stream = v8.getHeapSnapshot();
stream.pipe(process.stdout);
```

## `v8.getHeapSpaceStatistics()`
<!-- YAML
added: v6.0.0
Expand Down Expand Up @@ -97,26 +117,6 @@ The value returned is an array of objects containing the following properties:
]
```

## `v8.getHeapSnapshot()`
<!-- YAML
added: v11.13.0
-->

* Returns: {stream.Readable} A Readable Stream containing the V8 heap snapshot

Generates a snapshot of the current V8 heap and returns a Readable
Stream that may be used to read the JSON serialized representation.
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, and may change from one version of V8 to the next.

```js
// Print heap snapshot to the console
const v8 = require('v8');
const stream = v8.getHeapSnapshot();
stream.pipe(process.stdout);
```

## `v8.getHeapStatistics()`
<!-- YAML
added: v1.0.0
Expand Down