fix(ext/node): add missing process.constrainedMemory() API#32209
Merged
bartlomieju merged 7 commits intodenoland:mainfrom Feb 18, 2026
Merged
fix(ext/node): add missing process.constrainedMemory() API#32209bartlomieju merged 7 commits intodenoland:mainfrom
process.constrainedMemory() API#32209bartlomieju merged 7 commits intodenoland:mainfrom
Conversation
Make process.config and its nested objects immutable via Object.freeze() to match Node.js behavior. Enable test-process-config.js node compat test. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…emory() Add process.availableMemory() using Deno.systemMemoryInfo().available and process.constrainedMemory() backed by a new op that reads cgroup memory limits on Linux. Also freeze process.config for immutability. Enable three node compat tests: test-process-config.js, test-process-available-memory.js, test-process-constrained-memory.js. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Fix process event methods (on, off, emit, prependListener) to handle
Symbol event names by guarding `startsWith("SIG")` checks with a
`typeof event === "string"` check. Also fix process.emit to always
dispatch through EventEmitter rather than sending OS signals.
Enable test-process-emit.js and test-process-beforeexit-throw-exit.js
node compat tests.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Extract cgroup parsing logic used by `process.constrainedMemory()` into a shared `cgroup` module in `ext/node/ops/process.rs`, and reuse it from `cli/lib/worker.rs` instead of duplicating the parser. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
process.constrainedMemory() API
Replace disallowed `std::fs::read_to_string` calls in cgroup module with `sys.fs_read_to_string` via the `ExtNodeSys` trait, matching the pattern used elsewhere in the codebase. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
fraidev
approved these changes
Feb 18, 2026
Contributor
fraidev
left a comment
There was a problem hiding this comment.
LGTM!
Also tested on docker with a log and I got the same result from node:
docker run --rm -m 256m -v $PWD:/app -w /app node node a.js
268435456
docker run --rm -m 256m -v $PWD:/app -w /app debian ./target/debug/deno a.js
268435456
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
process.constrainedMemory()into a shared publiccgroupmodule inext/node/ops/process.rscli/lib/worker.rs(V8 heap limit configuration) instead of duplicating itparallel/test-process-constrained-memory.jstest🤖 Generated with Claude Code