Skip to content

Commit 9b88384

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 0498562 commit 9b88384

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
@@ -2861,6 +2861,13 @@ The `process.memoryUsage()` method iterates over each page to gather
28612861
information about memory usage which might be slow depending on the
28622862
program memory allocations.
28632863
2864+
### A note on process memoryUsage
2865+
2866+
On Linux or other systems where glibc is commonly used, an application may have sustained
2867+
`rss` growth despite stable `heapTotal` due to fragmentation caused by the glibc `malloc`
2868+
implementation. See [nodejs/node#21973][] on how to switch to an alternative `malloc`
2869+
implementation to address the performance issue.
2870+
28642871
## `process.memoryUsage.rss()`
28652872
28662873
<!-- YAML
@@ -4575,6 +4582,7 @@ cases:
45754582
[debugger]: debugger.md
45764583
[deprecation code]: deprecations.md
45774584
[loading ECMAScript modules using `require()`]: modules.md#loading-ecmascript-modules-using-require
4585+
[nodejs/node#21973]: https://github.com/nodejs/node/issues/21973
45784586
[note on process I/O]: #a-note-on-process-io
45794587
[process.cpuUsage]: #processcpuusagepreviousvalue
45804588
[process_emit_warning]: #processemitwarningwarning-type-code-ctor

0 commit comments

Comments
 (0)