-
Notifications
You must be signed in to change notification settings - Fork 15.3k
[Workers] Add memory usage metrics changelog and docs #31695
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: production
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,25 @@ | ||||||
| --- | ||||||
| title: Track memory usage for Workers and Durable Objects in the dashboard | ||||||
| description: The Workers Metrics tab now includes a Memory Usage chart that shows V8 isolate memory consumption across percentiles, helping you track memory trends and detect regressions. | ||||||
| products: | ||||||
| - workers | ||||||
| date: 2026-06-25 | ||||||
| --- | ||||||
|
|
||||||
| You can now monitor how much memory your Worker consumes across invocations with the new **Memory Usage** chart in the Workers Metrics tab, broken down by P50, P90, P99, and P999 percentiles. | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
|  | ||||||
|
|
||||||
| Memory usage measures the V8 [isolate](/workers/reference/how-workers-works/#isolates) memory at the time of each invocation. This is the same memory pool subject to the [128 MB per-isolate limit](/workers/platform/limits/#memory) — a single isolate can handle many concurrent requests and shares memory across them. | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can we not call this a "pool"? Similar in concept but not literally what this is?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
@iglesiasbrandon @vy-ton need to make sure we are explaining Durable Objects model here / somewhere / link to somewhere — to the extent reader needs to understand this in order to understand what the DO metric is or means |
||||||
|
|
||||||
| Use the Memory Usage chart to: | ||||||
|
|
||||||
| - **Track memory trends** — Spot gradual increases that may indicate a memory leak before they cause `Exceeded Memory` errors. | ||||||
| - **Correlate with deployments** — Deployment markers on the chart help you identify whether a new version introduced a memory regression. | ||||||
| - **Right-size your Worker** — Understand your baseline memory footprint and how much headroom you have before hitting the 128 MB limit. | ||||||
|
|
||||||
| Memory usage metrics are also available for Durable Objects. | ||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should add some DO specific information, maybe something along the lines of: For Durable Objects, memory usage reflects the in-memory state an object holds (class properties, caches, active WebSocket connections), which persists across invocations until the object is hibernated or evicted. This state is not preserved across eviction, hibernation, or a crash, so persist anything important to storage. |
||||||
|
|
||||||
| To view memory usage, go to **Workers & Pages**, select your Worker, and open the **Metrics** tab. You can also query memory usage programmatically via the [GraphQL Analytics API](/analytics/graphql-api/tutorials/querying-workers-metrics/) using the `workersInvocationsAdaptive` dataset — the `quantiles.memoryUsageBytesP50` through `quantiles.memoryUsageBytesP999` fields return percentile values in bytes. | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What about for Durable Objects?
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the experience is almost the same except but on the DO page with 1 addition, @nevikashah can you also mention on the DO metrics tab you are able to filter by DO ID or Name so you can drill down and understand if that DO ran into issues because of memory? |
||||||
|
|
||||||
| For local memory debugging, you can also [profile memory with DevTools](/workers/observability/dev-tools/memory-usage/) to take heap snapshots and identify specific objects causing high memory usage. | ||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add the durable objects here