-
-
Notifications
You must be signed in to change notification settings - Fork 140
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Report a bug
Memory leak when an arktype validator is instantiated, even with something as simple as type("string"), and anything else that instantiates a type, like type.pick() or type.and(other).
Memory does not leak on type.to(other), or type.keyof()
🔎 Search Terms
OOM, memory leak
🧩 Context
- ArkType version: 2.1.29
- TypeScript version (5.1+): 5.9.3
- Other context you think may be relevant (JS flavor, OS, etc.):
Node 24.13.0
🧑💻 Repro
// test-arktype-memory.ts
import { type } from "arktype";
// import { z } from "zod";
const BATCH = 1_000;
let i = 0;
while (true) {
{
testArkType();
}
if (++i % BATCH === 0) {
i = 0
global.gc?.();
console.log(
`${(process.memoryUsage().heapUsed / 1024 / 1024).toFixed(2)} MB`,
);
}
}
// function testZod() {
// z.string().transform((x) => parseInt(x)).parse('1');
// }
function testArkType() {
type("string")('1');
}Run with: node --expose-gc --no-warnings test-arktype-memory.ts
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working
Type
Projects
Status
To do