deno
ba41af74 - feat: make --max-memory limit total RSS instead of only the V8 heap

Commit
106 days ago
feat: make --max-memory limit total RSS instead of only the V8 heap Replaces the V8 near-heap-limit callback with a watchdog thread that samples the process resident set size (RSS) and terminates the isolate when it exceeds the budget. This caps the whole process (V8 heap + external ArrayBuffers + native allocations), matching what users expect from a '--max-memory' flag, and makes the memory limit consistent with the --max-cpu-time and --max-time watchdogs (shared terminate-and-exit path). The cap is sampled at 20ms, so a program allocating very fast may briefly overshoot before being terminated. Exposes ext/os::get_process_rss(), updates the help text, and bumps the spec-test limits above the runtime's baseline RSS footprint.
Author
Parents
Loading