温馨提示:本站仅提供公开网络链接索引服务,不存储、不篡改任何第三方内容,所有内容版权归原作者所有
AI智能索引来源:http://www.bun.com/reference/node/v8/getHeapSnapshot
点击访问原文链接

Node v8.getHeapSnapshot function | API Reference | Bun

Node v8.getHeapSnapshot function | API Reference | BunBuildDocsReferenceGuidesBlogDiscord/node:v8/getHeapSnapshotFgetHeapSnapshot

Search the reference...

/

BuildDocsReferenceGuidesBlogDiscord/node:v8/getHeapSnapshotFgetHeapSnapshot

function

v8.getHeapSnapshotfunction getHeapSnapshot(options?: HeapSnapshotOptions): Readable;

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.

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.

// Print heap snapshot to the console
import v8 from 'node:v8';
const stream = v8.getHeapSnapshot();
stream.pipe(process.stdout);
@returns

A Readable containing the V8 heap snapshot.

Referenced typesinterface HeapSnapshotOptionsexposeInternals?: boolean

If true, expose internals in the heap snapshot.

exposeNumericValues?: boolean

If true, expose numeric values in artificial fields.

Resources

ReferenceDocsGuidesDiscordMerch StoreGitHubBlog 

Toolkit

RuntimePackage managerTest runnerBundlerPackage runner

Project

Bun 1.0Bun 1.1Bun 1.2Bun 1.3RoadmapContributingLicense

Baked with ❤️ in San Francisco

We're hiring →

Node v8.getHeapSnapshot function | API Reference | Bun,AI智能索引,全网链接索引,智能导航,网页索引

    API documentation for function node:v8.getHeapSnapshot | Bun