v8 API Deep Dive

External Buffer Memory Example

  • a heapsnapshot is just a JSON file containing info about all objects found on the heap represented as nodes
  • but a snapshot has gzillions of those nodes
{
  "snapshot": {
    "meta": {
      "node_fields": [ "type", "name", "id", "self_size", "edge_count", "trace_node_id" ],
      "node_types": [ [ "hidden", "array", "string", "object", "code", "closure", "regexp", "number", "native", "synthetic", "concatenated string", "sliced string" ] ]
    },

  "nodes": [ 9, 1, 1, 0, 7, 0, 9, 2, 3, 0, 17, 0, 9, 3, 5, 0, 1517, 0, 9, 4, 7, 0, 0, 0, 9, 5, 9, 0, 347, 0, 9, 6, 11, 0, 0, 0, 9, 7, 13, 0, 0, 0 ]
}