Skip to content

Commit eebbf1e

Browse files
Document browser memory tiers and page crash recovery (#700)
* Document browser memory tiers and page crash recovery * Make the headless memory ceiling and crash recovery actionable * Read through the new memory and crash guidance for clarity
1 parent 1ea676c commit eebbf1e

5 files changed

Lines changed: 25 additions & 6 deletions

File tree

‎browsers/concurrency-and-limits.mdx‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,13 @@ If you're hitting the ceiling in normal operation, [contact us](https://calendly
5151

5252
| Resource | Headful | Headless |
5353
| --- | --- | --- |
54-
| Default memory | 8 GB | 1 GB |
54+
| Memory | 8 GB or 16 GB | 1 GB, 2 GB, or 4 GB |
5555

56-
Memory is the practical ceiling on how many tabs and how heavy a page one browser handles. A [headless](/browsers/headless) browser at 1 GB is sized for short-lived, single-page, high-concurrency automation; open a dozen heavy tabs in one and Chromium starts killing renderers. If your workload needs many concurrent pages, spread it across more browsers rather than more tabs in one. non-gpu browsers support `2GiB` or `4GiB` headless, or `16GiB` headful: set `memory` when you [create a browser](https://www.kernel.sh/docs/api-reference/browsers/create-a-browser-session) or [browser pool](/browsers/pools) for workloads that need more than the default.
56+
Memory is the practical ceiling on how heavy a page one browser can hold. When a browser runs out of memory, the kernel kills a Chromium process and the page fails with `Page crashed` or `Target crashed`. One heavy page can do this on its own — it doesn't take many tabs. See [a crashed page](/browsers/playwright-execution#a-crashed-page).
57+
58+
Memory is set when the browser is created and can't be changed on a running browser: headless browsers take `1GiB`, `2GiB`, or `4GiB`, and headful browsers take `8GiB` (the default) or `16GiB`. Pass `memory` to [create](/api-reference/browsers/create-a-browser-session) or set it on a [browser pool](/browsers/pools); a pool change applies only to browsers built after it.
59+
60+
If pages are dying, create the browser with more memory, or spread the work across more browsers rather than more tabs in one. To check memory before a page fails, run `free -m` inside the session and watch `available`. If it trends toward zero before the page dies, the page's working set is the problem. See [measure memory and CPU usage](/browsers/process-execution#measure-memory-and-cpu-usage).
5761

5862
[GPU acceleration](/browsers/gpu-acceleration) is a separate browser type with its own [usage rate](/info/pricing#usage-rates), available on Start-Up and Enterprise.
5963

‎browsers/headless.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ title: "Headless Mode"
44

55
Kernel browsers ship in `headful` mode by default. In headful mode, the launched browser has a corresponding GUI. This enables features like [live view](/browsers/live-view) and [replays](/browsers/replays).
66

7-
`headless` mode runs without a visual interface. They generally run faster and have a lighter footprint (1 GB by default rather than headful's 8 GB), resulting in significant cost savings. This is useful for short-lived or highly concurrent browser automations.
7+
`headless` mode runs without a visual interface. They generally run faster and have a lighter footprint (1 GB by default rather than headful's 8 GB), resulting in significant cost savings. This is useful for short-lived or highly concurrent browser automations, but a single heavy page can exhaust the 1 GB default, so [size the browser to the page](/browsers/concurrency-and-limits#per-browser-resources) rather than assuming headless only suits light work.
88
Some bot detectors may detect headless mode.
99

1010
for more memory on a non-gpu browser, set `memory` to `2GiB` or `4GiB` when you [create a headless browser](https://www.kernel.sh/docs/api-reference/browsers/create-a-browser-session) or [headless browser pool](/browsers/pools). the default remains `1GiB`.

‎browsers/playwright-execution.mdx‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,20 @@ Deleting `default` restarts it instead of removing it: its process is stopped, a
424424

425425
After a timeout, the executor keeps its process but drops its browser connection, so code abandoned by the timeout can't keep driving the browser. After a crash or a blocked event loop, the next call on that executor starts a fresh process. Either way, other executors keep running.
426426

427+
### A crashed page
428+
429+
`Page crashed` and `Target crashed` mean the tab is gone. The browser [ran out of memory](/browsers/concurrency-and-limits#per-browser-resources) and the kernel killed a Chromium process. The error names the page rather than the cause.
430+
431+
The browser survives, and so do its cookies, local storage, and logged-in sessions, because those belong to the browser rather than the tab. What's lost is everything the page held in memory: JavaScript state, `sessionStorage`, and any request in flight.
432+
433+
Recover by navigating again. Nothing about the page's position survives, so code that assumes a populated form, an open dialog, or a specific page must navigate and wait before continuing.
434+
435+
A named executor replaces a missing tab: if its tab is gone, the call is sent again on a new one.
436+
437+
A crash doesn't tell you whether the step you were running took effect. Before you resend an action that writes something, check the page or the downstream system for the expected result. Follow the [unknown-outcome guidance](/browsers/webmcp#handle-an-unknown-outcome).
438+
439+
If the crashes recur, recreate the browser headful with more memory or spread the work across more browsers. To confirm the cause, enable [telemetry](/browsers/telemetry/overview); the default set includes the `system` category, whose [`system_oom_kill`](/browsers/telemetry/categories) event reports the killed process's memory.
440+
427441
## Timeout configuration
428442

429443
Set `timeout_sec` for the work each request performs. The API defaults to 60 seconds and allows up to 300 seconds, but most short scripts don't need that budget. Start with:

‎introduction/configure.mdx‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ The response includes everything you need to drive the browser: `session_id`, `c
6161

6262
| Type | When to use it | How to set it |
6363
| --- | --- | --- |
64-
| **Headful** (default) | Agents on real sites. It has a real display, so [live view](/browsers/live-view) and [replays](/browsers/replays) work and bot detectors see a normal browser. 8 GB of memory by default. | Nothing to set |
65-
| **[Headless](/browsers/headless)** | Short-lived or highly concurrent jobs that don't need to be watched. Lighter, at 1 GB by default, but some bot detectors notice it. | `headless: true` |
64+
| **Headful** (default) | Agents on real sites. It has a real display, so [live view](/browsers/live-view) and [replays](/browsers/replays) work and bot detectors see a normal browser. 8 GB of memory by default, or 16 GB with `memory`. | `memory: "8GiB"` or `"16GiB"` |
65+
| **[Headless](/browsers/headless)** | High-volume or short-lived work that doesn't need to be watched. 1 GB by default, or 2 GB and 4 GB with `memory`; some bot detectors notice it. | `headless: true` |
6666
| **[GPU-accelerated](/browsers/gpu-acceleration)** | WebGL, video, and canvas-heavy sites. Headful only, doesn't support standby, and has its own usage rate. | `gpu: true` |
6767

6868
## Set common options
@@ -83,6 +83,7 @@ browser = kernel.browsers.create(
8383
```
8484
</CodeGroup>
8585

86+
- **[Memory](/browsers/concurrency-and-limits#per-browser-resources):** headless browsers take `1GiB`, `2GiB`, or `4GiB`; headful browsers take `8GiB` (the default) or `16GiB`. Memory is set at creation and can't be changed on a running browser.
8687
- **[Viewport](/browsers/viewport):** defaults to 1920x1080 at 25Hz. A custom viewport restarts Chromium on creation, so use a [browser pool](/browsers/pools) if you need it to be instant.
8788
- **[Termination and timeouts](/browsers/termination):** `timeout_seconds` sets how long a browser can sit in standby before KERNEL deletes it. It defaults to 60 seconds and can be up to 72 hours. Delete browsers explicitly when you're done; Playwright's `browser.close()` doesn't delete them.
8889

‎introduction/create.mdx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ Most of what you'll tune at creation time falls into four buckets:
7474

7575
<Columns cols={2}>
7676
<Card title="Headless vs headful" href="/browsers/headless">
77-
headful (default) supports live view, replays, and better stealth — ideal for agent workflows on bot-detected sites. headless is lighter (1 gb vs 8 gb), good for simple scraping.
77+
Headful (default) supports live view, replays, and better stealth, and takes 8 GB or 16 GB of memory. Headless is lighter, from 1 GB up to 4 GB, which suits high-volume work.
7878
</Card>
7979
<Card title="Stealth and proxies" href="/browsers/bot-detection/overview">
8080
Turn on stealth mode and route through residential or ISP proxies when you're hitting sites with bot detection.

0 commit comments

Comments
 (0)