Skip to content

Commit cbb0a8e

Browse files
fengmk2joyeecheung
authored andcommitted
doc: add note on process memoryUsage
Co-authored-by: Joyee Cheung <joyeec9h3@gmail.com> PR-URL: #59026 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: Zeyu "Alex" Yang <himself65@outlook.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
1 parent 9892b15 commit cbb0a8e

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
@@ -4594,6 +4601,7 @@ cases:
45944601
[debugger]: debugger.md
45954602
[deprecation code]: deprecations.md
45964603
[loading ECMAScript modules using `require()`]: modules.md#loading-ecmascript-modules-using-require
4604+
[nodejs/node#21973]: https://github.com/nodejs/node/issues/21973
45974605
[note on process I/O]: #a-note-on-process-io
45984606
[process.cpuUsage]: #processcpuusagepreviousvalue
45994607
[process_emit_warning]: #processemitwarningwarning-type-code-ctor

0 commit comments

Comments
 (0)