Skip to content

Commit 31a9283

Browse files
fengmk2joyeecheung
authored andcommitted
doc: add note on process memoryUsage
Co-authored-by: Joyee Cheung <[email protected]> PR-URL: #59026 Reviewed-By: Joyee Cheung <[email protected]> Reviewed-By: Zeyu "Alex" Yang <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
1 parent 5a98bff commit 31a9283

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

doc/api/process.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2890,6 +2890,13 @@ The `process.memoryUsage()` method iterates over each page to gather
28902890
information about memory usage which might be slow depending on the
28912891
program memory allocations.
28922892
2893+
### A note on process memoryUsage
2894+
2895+
On Linux or other systems where glibc is commonly used, an application may have sustained
2896+
`rss` growth despite stable `heapTotal` due to fragmentation caused by the glibc `malloc`
2897+
implementation. See [nodejs/node#21973][] on how to switch to an alternative `malloc`
2898+
implementation to address the performance issue.
2899+
28932900
## `process.memoryUsage.rss()`
28942901
28952902
<!-- YAML
@@ -4631,6 +4638,7 @@ cases:
46314638
[debugger]: debugger.md
46324639
[deprecation code]: deprecations.md
46334640
[loading ECMAScript modules using `require()`]: modules.md#loading-ecmascript-modules-using-require
4641+
[nodejs/node#21973]: https://github.com/nodejs/node/issues/21973
46344642
[note on process I/O]: #a-note-on-process-io
46354643
[process.cpuUsage]: #processcpuusagepreviousvalue
46364644
[process_emit_warning]: #processemitwarningwarning-type-code-ctor

0 commit comments

Comments
 (0)