Runtime.getHeapUsageReturns the JavaScript heap usage. It is the total usage of the corresponding isolate not scoped to a particular Runtime.
| Name | Type | Description |
|---|---|---|
usedSize | number | Used JavaScript heap size in bytes. |
totalSize | number | Allocated JavaScript heap size in bytes. |
embedderHeapUsedSize | number | Used size in bytes in the embedder's garbage-collected heap. |
backingStorageSize | number | Size in bytes of backing storage for array buffers and external strings. |
{
"id": 1,
"method": "Runtime.getHeapUsage"
}
{
"id": 1,
"result": {
"usedSize": 1.0,
"totalSize": 1.0,
"embedderHeapUsedSize": 1.0,
"backingStorageSize": 1.0
}
}
const result = await send('Runtime.getHeapUsage');
console.log(result);
// {"usedSize": 1.0, "totalSize": 1.0, "embedderHeapUsedSize": 1.0, "backingStorageSize": 1.0}