V8 Project
|
HeapSnapshots record the state of the JS heap at some moment. More...
#include <v8-profiler.h>
Public Types | |
enum | SerializationFormat { kJSON = 0 } |
Public Member Functions | |
unsigned | GetUid () const |
Returns heap snapshot UID (assigned by the profiler.) More... | |
Handle< String > | GetTitle () const |
Returns heap snapshot title. More... | |
const HeapGraphNode * | GetRoot () const |
Returns the root node of the heap graph. More... | |
const HeapGraphNode * | GetNodeById (SnapshotObjectId id) const |
Returns a node by its id. More... | |
int | GetNodesCount () const |
Returns total nodes count in the snapshot. More... | |
const HeapGraphNode * | GetNode (int index) const |
Returns a node by index. More... | |
SnapshotObjectId | GetMaxSnapshotJSObjectId () const |
Returns a max seen JS object Id. More... | |
void | Delete () |
Deletes the snapshot and removes it from HeapProfiler's list. More... | |
void | Serialize (OutputStream *stream, SerializationFormat format) const |
Prepare a serialized representation of the snapshot. More... | |
HeapSnapshots record the state of the JS heap at some moment.
Definition at line 303 of file v8-profiler.h.
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 7309 of file api.cc.
References v8::internal::HeapProfiler::DeleteAllSnapshots(), v8::internal::HeapProfiler::GetSnapshotsCount(), v8::internal::Isolate::heap_profiler(), and v8::ToInternal().
SnapshotObjectId v8::HeapSnapshot::GetMaxSnapshotJSObjectId | ( | ) | const |
Returns a max seen JS object Id.
Definition at line 7354 of file api.cc.
References v8::ToInternal().
const HeapGraphNode * v8::HeapSnapshot::GetNode | ( | int | index | ) | const |
Returns a node by index.
Definition at line 7348 of file api.cc.
References v8::ToInternal().
const HeapGraphNode * v8::HeapSnapshot::GetNodeById | ( | SnapshotObjectId | id | ) | const |
Returns a node by its id.
Definition at line 7337 of file api.cc.
References v8::ToInternal().
int v8::HeapSnapshot::GetNodesCount | ( | ) | const |
Returns total nodes count in the snapshot.
Definition at line 7343 of file api.cc.
References v8::ToInternal().
const HeapGraphNode * v8::HeapSnapshot::GetRoot | ( | ) | const |
Returns the root node of the heap graph.
Definition at line 7332 of file api.cc.
References v8::ToInternal().
Returns heap snapshot title.
Definition at line 7325 of file api.cc.
References v8::internal::Isolate::factory(), and v8::ToInternal().
unsigned v8::HeapSnapshot::GetUid | ( | ) | const |
Returns heap snapshot UID (assigned by the profiler.)
Definition at line 7320 of file api.cc.
References v8::ToInternal().
void v8::HeapSnapshot::Serialize | ( | OutputStream * | stream, |
HeapSnapshot::SerializationFormat | format | ||
) | 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 7359 of file api.cc.
References v8::Utils::ApiCheck(), v8::OutputStream::GetChunkSize(), v8::internal::HeapSnapshotJSONSerializer::Serialize(), and v8::ToInternal().