Skip to content

Commit da6af28

Browse files
committed
doc: add externalBytes to heap profiler documentation
Document the externalBytes field in getAllocationProfile output. Signed-off-by: Rudolf Meijering <[email protected]>
1 parent d5fa37d commit da6af28

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

doc/api/v8.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1503,12 +1503,17 @@ not running.
15031503
"samples": [
15041504
{ "nodeId": 1, "size": 128, "count": 4, "sampleId": 42,
15051505
"labels": { "route": "/users/:id" } }
1506+
],
1507+
"externalBytes": [
1508+
{ "labels": { "route": "/users/:id" }, "bytes": 1048576 }
15061509
]
15071510
}
15081511
```
15091512
15101513
* `samples[].labels` — key-value string pairs from the active label context
15111514
at allocation time. Empty object if no labels were active.
1515+
* `externalBytes[]` — live `Buffer`/`ArrayBuffer` backing-store bytes per
1516+
label context. Complements heap samples which only see the JS wrapper.
15121517
15131518
### `v8.withHeapProfileLabels(labels, fn)`
15141519
@@ -1551,9 +1556,9 @@ Prefer [`v8.withHeapProfileLabels()`][] when possible for automatic cleanup.
15511556
### Limitations — what is measured
15521557
15531558
Heap samples cover V8 heap allocations (JS objects, strings, closures).
1559+
`externalBytes` covers `Buffer`/`ArrayBuffer` backing stores.
15541560
1555-
Not measured: `Buffer`/`ArrayBuffer` backing stores, native addon memory,
1556-
JIT code space, OS-level allocations.
1561+
Not measured: native addon memory, JIT code space, OS-level allocations.
15571562
15581563
## Class: `v8.GCProfiler`
15591564

0 commit comments

Comments
 (0)