RSS counts all memory of the process that sits in RAM, including Buffers and native allocations outside the JavaScript heap
RSS counts all of the process's memory that sits in RAM, not only the JavaScript heap. RSS (resident set size) is the physical memory the process holds right now. It includes:
• the whole V8 heap, including space that is allocated but not used yet
• thread stacks and compiled code
• memory outside V8, such as Buffer contents and native addons
So a large gap between rss and heapUsed usually means Buffers or native memory.
"RSS includes memory that was swapped out to disk" is wrong. Swapped-out pages are not in RAM, so RSS does not count them. "RSS is the virtual address space the process has reserved" is also wrong. Reserved but untouched address space counts toward VSZ (virtual size), not RSS.