process: add direct access to rss without iterating pages

Accessing the rss value through memoryUsage() can be expensive
because this method will also generate  memory usage statistics
by iterating on each page.
This commit intend to offer a more direct access to rss value.

Refs: #33384

PR-URL: https://github.com/nodejs/node/pull/34291
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
Adrien Maret 2020-12-29 15:36:41 +01:00 committed by Node.js GitHub Bot
parent d548f4d116
commit 83ab5433ff
4 changed files with 41 additions and 1 deletions

View file

@ -44,3 +44,5 @@ if (r.arrayBuffers > 0) {
assert.strictEqual(after.arrayBuffers - r.arrayBuffers, size,
`${after.arrayBuffers} - ${r.arrayBuffers} === ${size}`);
}
assert(process.memoryUsage.rss() > 0);