Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lib, src: add maxmem prop in os module #51102

Closed
wants to merge 1 commit into from

Conversation

MrJithil
Copy link
Member

@MrJithil MrJithil commented Dec 9, 2023

Fixes #51095

add maxmem prop in os module

Eg:
require('os').maxmem()

which will use the uv_get_constrained_memory for getting the memory limits

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run. os Issues and PRs related to the os subsystem. typings labels Dec 9, 2023
@targos
Copy link
Member

targos commented Dec 9, 2023

This should probably have a name closer to the one of the libuv function

Copy link
Member

@richardlau richardlau left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We already have process.constrainedMemory() added by #46218.

@jasnell
Copy link
Member

jasnell commented Dec 9, 2023

As pointed out by @richardlau we already have an api for this.

@jasnell jasnell closed this Dec 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++ Issues and PRs that require attention from people who are familiar with C++. needs-ci PRs that need a full CI run. os Issues and PRs related to the os subsystem. typings
Projects
None yet
Development

Successfully merging this pull request may close these issues.

os.totalmem() missleading output in docker-container with memory-limit
5 participants