You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Out of memory error when inintializing a merged type with a lot of or #1652
When I create a complex type, I get out-of-memory errors when initializing the type. This example also crashes the ArkType playground. I like this project very much, but unfortunately the initialization times are a real deal-breaker for using ArkType in Cloudflare Workers. Once initialized, the validation is super fast.
🔎 Search Terms
Out of memory
Memory leak
🧩 Context
ArkType version: 2.2.3
TypeScript version (5.1+): 5.9.3
Other context you think may be relevant (JS flavor, OS, etc.): Node 24.12.0
fixed in arktype 3.0 (quadratic union reduction / discrimination fixes + lazy jit) — the 11-merge repro now initializes in ~110–160ms (~66mb heap) instead of ooming, and @ark/aot eliminates runtime init overhead on workers. (structurally, n chained .merge(a | b) calls still expand to 2^n dnf branches, so past ~11 nested pairs or a flat { foo1: "string | null", ... } with .narrow(...) keeps it o(n).) closing — reopen if you still hit anything on 3.0.1.
Activity
pullfrog commentedon Aug 22, 2026
perf(sets): reduce wide unions of objects without intersecting every …
fix(sets,type): gate draft-07 keywords, enforce own keys in const, an…
perf(sets): intersect two objects without work that decides nothing
ssalbdivad commentedon Dec 3, 2026
fixed in arktype 3.0 (quadratic union reduction / discrimination fixes + lazy jit) — the 11-merge repro now initializes in ~110–160ms (~66mb heap) instead of ooming, and
@ark/aoteliminates runtime init overhead on workers. (structurally,nchained.merge(a | b)calls still expand to2^ndnf branches, so past ~11 nested pairs or a flat{ foo1: "string | null", ... }with.narrow(...)keeps ito(n).) closing — reopen if you still hit anything on 3.0.1.