From cea1c2d52c4c65e50b9ab7527d863ce19a93b22d Mon Sep 17 00:00:00 2001 From: Anthony Nandaa Date: Sat, 28 Oct 2017 01:06:52 +0300 Subject: [PATCH 1/2] doc: adds details about rss on process.memoryUsage `process.memoryUsage()` returns an object with 4 keys: `rss, heapTotal, headUsed, external`. There were brief explanations for the rest except `rss`. This commit adds this on the docs. --- doc/api/process.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/doc/api/process.md b/doc/api/process.md index 2ab83806d4d1c5..4a74eb90a71c83 100644 --- a/doc/api/process.md +++ b/doc/api/process.md @@ -1282,7 +1282,12 @@ Will generate: `heapTotal` and `heapUsed` refer to V8's memory usage. `external` refers to the memory usage of C++ objects bound to JavaScript -objects managed by V8. +objects managed by V8. `rss`, Resident Set Size, is the total space allocated in +memory for the process, which includes the _heap_, _code segment_ and _stack_. + +The _heap_ is where objects, strings and closures are stored. Variables are +stored in the _stack_ and the actual JavaScript code resides in the +_code segment_. ## process.nextTick(callback[, ...args])