Document how to measure session memory with process execution - #624
Conversation
Add a section to the process execution page covering whole-session memory via free, per-process RSS via ps, and a spawn-and-stream sampler for tracking usage over a run. Notes that process.status only reports memory for API-spawned processes, points at the system_oom_kill telemetry event for crash-time memory, and documents the CLI's comma splitting of --args. All examples verified against live headless and headful sessions. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Automations to automatically generate PRs for you. |
There was a problem hiding this comment.
Risk assessment: Very Low
This PR changes one file, browsers/process-execution.mdx (+159 / −0). It adds a docs section on measuring session memory and CPU from inside an existing browser session (free, ps, top), with TypeScript and Python examples of the process-execution APIs already documented on this page, plus a CLI note that --args is split on commas.
Checked against the diff:
- No application code, API specs, auth, config, or infrastructure files changed
- No production behavior or shared systems modified
- The page is product documentation, not model instructions or prompts
maindoes not require a code owners review
Approving.
Sent by Cursor Automation: Assign PR reviewers
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want higher recall? High effort reviews run extra passes and find more bugs. A team admin can switch effort levels in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 3534009. Configure here.
|
|
||
| ### Read whole-session memory | ||
|
|
||
| `free` reports the memory allocated to your browser. A headless browser gets 1 GiB; a headful, non-GPU browser gets 8 GiB by default and 16 GiB when you set `memory` on [create](/api-reference/browsers/create-a-browser-session). |
There was a problem hiding this comment.
Relative API reference link
Medium Severity
The memory create-parameter link uses a relative /api-reference/ path. Those pages are generated from the remote OpenAPI spec and are not local .mdx files, so Mintlify's broken-link check treats the target as missing.
Triggered by learned rule: Use absolute URLs for /api-reference/ links
Reviewed by Cursor Bugbot for commit 3534009. Configure here.




Summary
There's no per-session memory number in the API, CLI, or dashboard, and customers asking "how much memory are my sessions using?" currently have no self-serve answer. Until a real metric ships, process execution already gives them one — this documents it.
Adds a Measure memory and CPU usage section to
browsers/process-execution.mdx:free, plus what the allocation is per browser type and whyavailableis the number to watch rather thanfree.ps -eo rss= -o comm= --sort=-rss, explaining why a tab-heavy workload appears as many mid-sizedchromiumrows, and how to sum them. Calls out that renderers aren't attributable to a specific tab.process.statusreportsmem_bytesonly for processes started throughprocess.spawnand doesn't populate CPU, sops/topare the answer for Chromium.systemtelemetry category for crash-time memory (system_oom_kill), framed as after-the-fact so it complements rather than replaces sampling.Also adds
free/topto the CLI examples and a warning that the CLI splits every--argsvalue on commas —ps -eo rss,commsilently runs asps -eo rss, even inside a quotedsh -cstring. That's a CLI parsing bug worth fixing separately; documenting it here so it doesn't bite anyone in the meantime.Verification
Every command and both SDK snippets were run against live headless and headful sessions. The
pssample output is real output. Confirmedfreereports the session's allocation (974 MiB on a headless browser, 7954 MiB on a default headful one) and thathtopisn't installed, so the examples usepsandtop.No test suite in this repo; Mintlify renders on deploy.
🤖 Generated with Claude Code
Note
Low Risk
Documentation-only changes with no runtime, API, or security impact.
Overview
Documents a self-serve workaround for the missing per-session memory metric in the API, CLI, and dashboard by using process execution inside the browser VM.
Adds a Measure memory and CPU usage section to
process-execution.mdx: whole-session totals withfree(including allocation by browser type and whyavailablematters), per-process RSS withps, summing Chromium processes, and time-series sampling viaprocess.spawn+ stdout streaming (with file I/O as an alternative). Clarifies thatprocess.statusonly covers spawned processes, not Chromium or CPU, and points tosystem_oom_killtelemetry for post-crash context.Also lists
free/topin the CLI examples, adds a measure memory headroom production pattern, and warns that the CLI splits--argson commas, which breaks comma-containingpsflags unless you use comma-free forms or the SDKs.Reviewed by Cursor Bugbot for commit 3534009. Bugbot is set up for automated code reviews on this repo. Configure here.