diff --git a/src/assets/images/changelog/workers/observability/2026-06-25-memory-usage.png b/src/assets/images/changelog/workers/observability/2026-06-25-memory-usage.png new file mode 100644 index 00000000000..f6a518abff4 Binary files /dev/null and b/src/assets/images/changelog/workers/observability/2026-06-25-memory-usage.png differ diff --git a/src/content/changelog/workers/2026-06-25-memory-usage-metrics.mdx b/src/content/changelog/workers/2026-06-25-memory-usage-metrics.mdx new file mode 100644 index 00000000000..9cda8161fb0 --- /dev/null +++ b/src/content/changelog/workers/2026-06-25-memory-usage-metrics.mdx @@ -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. + +![Memory usage chart showing P50, P90, P99, and P999 percentiles with deployment markers](~/assets/images/changelog/workers/observability/2026-06-25-memory-usage.png) + +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. + +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. + +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. + +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. diff --git a/src/content/docs/workers/observability/metrics-and-analytics.mdx b/src/content/docs/workers/observability/metrics-and-analytics.mdx index ef28c321eb0..77ce4e7a8f7 100644 --- a/src/content/docs/workers/observability/metrics-and-analytics.mdx +++ b/src/content/docs/workers/observability/metrics-and-analytics.mdx @@ -78,6 +78,16 @@ The CPU Time per execution chart shows historical CPU time data broken down into The Duration per request chart shows historical [duration](/workers/platform/limits/#duration) per Worker invocation. The data is broken down into relevant quantiles, similar to the CPU time chart. Learn more about [interpreting quantiles](https://www.statisticshowto.com/quantile-definition-find-easy-steps/). Understanding duration on your Worker is especially useful when you are intending to do a significant amount of computation on the Worker itself. +### Memory usage + +The Memory usage chart shows how much V8 isolate memory your Worker uses at the time of each invocation, broken down into P50, P90, P99, and P999 percentiles using [reservoir sampling](https://en.wikipedia.org/wiki/Reservoir_sampling). For more information, refer to [Interpreting quantiles](https://www.statisticshowto.com/quantile-definition-find-easy-steps/). + +Workers run in V8 [isolates](/workers/reference/how-workers-works/#isolates), each with a [128 MB memory limit](/workers/platform/limits/#memory). A single isolate can handle many concurrent requests and shares memory across them. The memory usage metric reflects how much of this shared pool is in use at the time of each invocation. + +Deployment markers on the chart let you correlate memory changes with specific code deployments, making it easier to identify whether a new version introduced a memory regression. + +If you see memory usage trending upward over time, this may indicate a memory leak. Use [memory profiling with DevTools](/workers/observability/dev-tools/memory-usage/) locally to take heap snapshots and identify specific objects causing high memory consumption. + ### Invocation statuses To review invocation statuses: