Skip to content

process.constrainedMemory() should map UINT64_MAX to 0, per node documentation #59227

Description

@Asaf-Federman

Version

v22.17.1

Platform

Linux#32-Ubuntu SMP Wed May 28 19:48:56 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux

Subsystem

No response

What steps will reproduce the bug?

Execute process.contrainedMemory() on any linux machine without any defined constraints.

How often does it reproduce? Is there a required condition?

When there is a constraining mechanism, but there is no constraint set

What is the expected behavior? Why is that the expected behavior?

According to node documentation, If there is a constraining mechanism, but there is no constraint set, 0 should be returned

What do you see instead?

node
Welcome to Node.js v22.17.1.
Type ".help" for more information.

os.totalmem()
2003443712
process.constrainedMemory()
18446744073709552000

Additional information

This code should be amended

Libuv doc: https://docs.libuv.org/en/v1.x/misc.html#c.uv_get_constrained_memory
Node doc: https://github.com/nodejs/node/blob/main/doc/api/process.md?plain=1#L1086

Metadata

Metadata

Assignees

No one assigned

    Labels

    processIssues and PRs related to the process subsystem.staleIssues and PRs marked stale due to inactivity and scheduled for automatic closure.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions