> ## Documentation Index
> Fetch the complete documentation index at: https://docs.browspark.krishm.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# devtools_memory

> Memory panel.

Memory panel. snapshot captures a .heapsnapshot artifact (opens in DevTools Memory) and summarizes objects by class with sizes and detached DOM node count. compare diffs two snapshots by class (growth). retainers lists what holds instances of a class. sampling start/stop records an allocation sampling profile (.heapprofile) with top allocating functions. usage returns current heap size; growth samples heap usage over time to spot leaks.

<Note>Heap snapshots, class diffs, retainers and allocation sampling need developer mode because Chrome does not expose HeapProfiler to extensions. usage and growth work in both modes.</Note>

## Parameters

<ParamField body="tabId" type="integer">
  Target tab id from browser\_tabs, which lists tabs across all windows. Defaults to the agent's most recently opened usable tab, or the only usable tab. Otherwise select a listed tabId.
</ParamField>

<ParamField body="action" type="enum" required>
  One of: `snapshot`, `compare`, `retainers`, `sampling`, `usage`, `growth`, `list`.
</ParamField>

<ParamField body="snapshotId" type="string">
   
</ParamField>

<ParamField body="other" type="string">
   
</ParamField>

<ParamField body="className" type="string">
   
</ParamField>

<ParamField body="limit" type="integer">
   
</ParamField>

<ParamField body="phase" type="enum">
  For sampling One of: `start`, `stop`.
</ParamField>

<ParamField body="intervalBytes" type="integer">
   
</ParamField>

<ParamField body="seconds" type="number">
  growth: duration, default 10
</ParamField>

<ParamField body="gc" type="boolean">
  Collect garbage first (default true for snapshot)
</ParamField>

## Example

```json theme={null}
{
  "tabId": 5001,
  "action": "snapshot"
}
```

```json Growth between two snapshots theme={null}
{
  "tabId": 5001,
  "action": "compare",
  "snapshotId": "snap-2",
  "other": "snap-1"
}
```

```json Sample heap usage for 20 seconds theme={null}
{
  "tabId": 1234,
  "action": "growth",
  "seconds": 20,
  "gc": true
}
```
