Skip to content

doc: add note on process memoryUsage #59026

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions doc/api/process.md
Original file line number Diff line number Diff line change
Expand Up @@ -2807,6 +2807,13 @@ The `process.memoryUsage()` method iterates over each page to gather
information about memory usage which might be slow depending on the
program memory allocations.

### A note on process memoryUsage

On Linux or other systems where glibc is commonly used, an application may have sustained
`rss` growth despite stable `heapTotal` due to fragmentation caused by the glibc `malloc`
implementation. See [nodejs/node#21973][] on how to switch to an alternative `malloc`
implementation to address the performance issue.

## `process.memoryUsage.rss()`

<!-- YAML
Expand Down Expand Up @@ -4547,6 +4554,7 @@ cases:
[debugger]: debugger.md
[deprecation code]: deprecations.md
[loading ECMAScript modules using `require()`]: modules.md#loading-ecmascript-modules-using-require
[nodejs/node#21973]: https://github.com/nodejs/node/issues/21973
[note on process I/O]: #a-note-on-process-io
[process.cpuUsage]: #processcpuusagepreviousvalue
[process_emit_warning]: #processemitwarningwarning-type-code-ctor
Expand Down
Loading