v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
v8::HeapSnapshot Class Reference

#include <v8-profiler.h>

Collaboration diagram for v8::HeapSnapshot:

Public Types

enum  SerializationFormat { kJSON = 0 }
 

Public Member Functions

const HeapGraphNodeGetRoot () const
 
const HeapGraphNodeGetNodeById (SnapshotObjectId id) const
 
int GetNodesCount () const
 
const HeapGraphNodeGetNode (int index) const
 
SnapshotObjectId GetMaxSnapshotJSObjectId () const
 
void Delete ()
 
void Serialize (OutputStream *stream, SerializationFormat format=kJSON) const
 

Detailed Description

HeapSnapshots record the state of the JS heap at some moment.

Definition at line 634 of file v8-profiler.h.

Member Enumeration Documentation

◆ SerializationFormat

Enumerator
kJSON 

Definition at line 636 of file v8-profiler.h.

Member Function Documentation

◆ Delete()

void v8::HeapSnapshot::Delete ( )

Deletes the snapshot and removes it from HeapProfiler's list. All pointers to nodes, edges and paths previously returned become invalid.

Definition at line 11653 of file api.cc.

Here is the call graph for this function:

◆ GetMaxSnapshotJSObjectId()

SnapshotObjectId v8::HeapSnapshot::GetMaxSnapshotJSObjectId ( ) const

Returns a max seen JS object Id.

Definition at line 11682 of file api.cc.

Here is the call graph for this function:

◆ GetNode()

const HeapGraphNode * v8::HeapSnapshot::GetNode ( int index) const

Returns a node by index.

Definition at line 11677 of file api.cc.

Here is the call graph for this function:

◆ GetNodeById()

const HeapGraphNode * v8::HeapSnapshot::GetNodeById ( SnapshotObjectId id) const

Returns a node by its id.

Definition at line 11668 of file api.cc.

Here is the call graph for this function:

◆ GetNodesCount()

int v8::HeapSnapshot::GetNodesCount ( ) const

Returns total nodes count in the snapshot.

Definition at line 11673 of file api.cc.

Here is the call graph for this function:

◆ GetRoot()

const HeapGraphNode * v8::HeapSnapshot::GetRoot ( ) const

Returns the root node of the heap graph.

Definition at line 11664 of file api.cc.

Here is the call graph for this function:

◆ Serialize()

void v8::HeapSnapshot::Serialize ( OutputStream * stream,
HeapSnapshot::SerializationFormat format = kJSON ) const

Prepare a serialized representation of the snapshot. The result is written into the stream provided in chunks of specified size. The total length of the serialized snapshot is unknown in advance, it can be roughly equal to JS heap size (that means, it can be really big - tens of megabytes).

For the JSON format, heap contents are represented as an object with the following structure:

{ snapshot: { title: "...", uid: nnn, meta: { meta-info }, node_count: nnn, edge_count: nnn }, nodes: [nodes array], edges: [edges array], strings: [strings array] }

Nodes reference strings, other nodes, and edges by their indexes in corresponding arrays.

Definition at line 11686 of file api.cc.

Here is the call graph for this function:

The documentation for this class was generated from the following files: