Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

205
Views
Chrome heap snapshot structure explanation

Using selenium, I took memory snapshot of a website with driver.execute_script(":takeHeapSnapshot") and extracted its metadata:

{
    "snapshot": {
        "meta": {
            "node_fields": [
                "type", "name", "id", "self_size", "edge_count", "trace_node_id", "detachedness"
            ],
            "node_types": [
                ["hidden", "array", "string", "object", "code", "closure", "regexp", "number", "native", "synthetic", "concatenated string", "sliced string", "symbol", "bigint"],
                "string", "number", "number", "number", "number", "number"
            ],
            "edge_fields": [
                "type", "name_or_index", "to_node"
            ],
            "edge_types": [
                ["context", "element", "property", "internal", "hidden", "shortcut", "weak"],
                "string_or_number", "node"
            ],
            "trace_function_info_fields": [
                "function_id", "name", "script_name", "script_id", "line", "column"
            ],
            "trace_node_fields": [
                "id", "function_info_index", "count", "size", "children"
            ],
            "sample_fields": [
                "timestamp_us", "last_assigned_id"
            ],
            "location_fields": [
                "object_index", "script_id", "line", "column"
            ]
        },
        "node_count": 6182075,
        "edge_count": 17793245,
        "trace_function_count": 0
    }
}

Can someone explain, please, what each field means and how to use that information to extract data? What are nodes, edges, location fields etc. As example, let's say, I have an ArrayBuffer on heap the size of which I know (and it's unique) and I want to retrieve this array. Is it possible to do with the snapshot?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

meta fields group explains the content of the different arrays of the snapshot.

The snapshot has the nodes array. This array has 7 numbers for every node in the heap and node_fields array describes the meaning for all of these 7 numbers.

at the same time node_types array describes the types for these 7 numbers. For example if you have the next 7 numbers in the nodes array [ ....., 2, 9, 13, 42, 0, 0, 0, ......

then the Nth node in the heap

  1. has "type" string, because node_types[0][2] == 'string',
  2. has "name" which is hidden in the strings array of the heap. i.e. strings[9],
  3. has "id" 13,
  4. uses 42 bytes of the heap
  5. has 0 references to the other objects in the heap
  6. has "trace_node_id" = 0,
  7. has "detachness" = 0,

The edges array has a triplet of numbers for the every edge and you could see the names of every number in the edges_fields and the types in the edge_types array. For example the triplet 2, 17, 79 in the edges array at the offset 0 means:

  1. the edge is actually a property of an object because edge_types[0][2] = 'property'
  2. the name of the property is hidden in the strings array with index 17
  3. and it points to the node with id 79. (actually I forgot, it is the index of the node or the id of the node)
  4. if the first node of the nodes array has the edge_count = 2, then the first 2 triplets of the edges array are the edges from this node to some other nodes, etc.

I hope this explanation could give you some light how to understand the content of the heap snapshot.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!