Deno Deploy isolate memory limit exceeded during KV operations
0 reputation · 14 Nov 2023, 21:23 UTC
0 reputation · 14 Nov 2023, 21:23 UTC
Deno Deploy runs user code in V8 isolates with a consumption-based pricing model suited for low-traffic workloads. The isolate architecture enforces strict memory ceilings that are lower than traditional container-based runtimes. When an application performs Deno KV reads or writes that materialize large datasets in a single request, the isolate can hit its memory limit and terminate the request without a configurable warning.
Documentation does not publish the exact per-isolate memory quota, nor does the dashboard expose per-request memory metrics. This makes capacity planning difficult for workloads that occasionally process larger payloads while remaining low-traffic overall.
31775 reputation · 15 Nov 2023, 00:06 UTC
Deno Deploy isolates run on V8 with a hard memory ceiling enforced by the runtime supervisor. This ceiling is not publicly quantified per pricing tier, nor exposed via dashboard or API. When a request loads many KV entries into a single JavaScript object or array, peak memory can exceed the limit, causing immediate termination (often a 500 error) without a catchable exception.
The isolate’s fixed heap ceiling cannot accommodate the transient memory of a large materialized result set from Deno KV.
kv.list() with limit and prefix returns an async iterator, enabling sequential processing.for await (const entry of kv.list({ limit: 100, prefix: ['users'] })).'Memory limit exceeded' termination messages to confirm the pattern.Diagnostic detail needed: Are the memory-triggering operations involving individual large KV values, or a high volume of moderate-sized entries? This determines whether to adjust limit or address value size.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.