From 542f3b9cc036d0f4d6470b18628aee9cfc3e12e4 Mon Sep 17 00:00:00 2001 From: Anthony Nandaa Date: Sat, 28 Oct 2017 01:06:52 +0300 Subject: [PATCH] doc: add details about rss on process.memoryUsage 1. `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. 2. A little more clarity on `rss` to help people disambiguate it from the virtual memory size. PR-URL: https://github.com/nodejs/node/pull/16566 Refs: https://github.com/nodejs/node/pull/16566#discussion_r147545405 Reviewed-By: Refael Ackermann Reviewed-By: Gibson Fahnestock Reviewed-By: Gireesh Punathil Reviewed-By: James M Snell Reviewed-By: Luigi Pinca --- doc/api/process.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/doc/api/process.md b/doc/api/process.md index 7a005503c9b2e2..ddc6d94acf31ca 100644 --- a/doc/api/process.md +++ b/doc/api/process.md @@ -1240,7 +1240,13 @@ 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 amount of space +occupied in the main memory device (that is a subset of the total allocated +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])