Skip to main content
← Back to list
01Issue
BugShippedSwamp CLIPublic
Assigneeszack

Relationships

#4941 Oversized resources are accepted silently at write time, then crash later runs with a V8 out-of-memory and no diagnosis

Opened by zack · 11/20/2026· Shipped 11/20/2026

Description

context.writeResource accepts resources of hundreds of MB without any warning. Later method or workflow runs that read those resources die with:

<--- Last few GCs --->
Mark-Compact (reduce) 4095.1 (4098.2) -> 4095.1 (4098.2) MB ... last resort; GC in old space requested
# Fatal JavaScript out of memory: Reached heap limit

The crash prints only a native stack, so nothing names the behavior, method, resource or version that was being loaded, and the run's lock is left behind until its TTL expires. In our case the same workflow first completed several steps and then crashed while writing its final resource; a rerun then crashed within 5 seconds of start, while loading existing data. The issue became impossible to advance with no indication of which record was responsible.

Swamp already records each data item's size (size is queryable), so the information needed to warn early exists.

Expected

  • At write time: a configurable per-resource size threshold that warns (and optionally refuses) with the behavior, resource name and size. The failure then happens at the write that created the problem, while the author can still act on it.
  • At read time: before materializing a resource whose recorded size is beyond what can be safely parsed, fail with a structured error naming the resource and its size instead of letting V8 abort the process.
  • swamp data query 'size > N' style tooling, or a swamp data subcommand, to list the largest resources per behavior so authors can find what to compact.

Notes

This may share a cause with #4477 when the reading run is a workflow: the crashing workflow's steps each write resources of tens to hundreds of MB, and its resume path re-reads completed steps' resources. The request here is the guardrail and diagnosis, independent of #4477's memory fix.

Version

swamp 20261119.221526.0-sha.b21dc9b8, Linux x86_64

02Bog Flow
✓OPEN✓TRIAGED✓IN PROGRESS✓SHIPPED+ 1 MOREASSIGNED+ 8 MOREREVIEW+ 21 MOREPR_LINKED+ 2 MORESESSION_SUMMARIZED

Shipped

11/20/2026, 7:01:19 PM

Click a lifecycle step above to view its details.

03Sludge Pulse
zack assigned zack11/20/2026, 4:43:42 PM

Sign in to post a ripple.