test: use faster variant for rss in test-crypto-dh-leak

PR-URL: https://github.com/nodejs/node/pull/36766
Refs: https://github.com/nodejs/node/pull/34291
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: Michael Dawson <midawson@redhat.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
Pooja D P authored and Danielle Adams committed 2021-01-12 07:11:43 -05:00
1 parent daad0ab1cc
commit cc37ff24dc
1 file changed
+2 -2
+2 -2
View File
@@ -10,7 +10,7 @@ if (process.config.variables.asan)
const assert = require('assert');
const crypto = require('crypto');
const before = process.memoryUsage().rss;
const before = process.memoryUsage.rss();
{
const dh = crypto.createDiffieHellman(common.hasFipsCrypto ? 1024 : 256);
const publicKey = dh.generateKeys();
@@ -21,7 +21,7 @@ const before = process.memoryUsage().rss;
}
}
global.gc();
const after = process.memoryUsage().rss;
const after = process.memoryUsage.rss();
// RSS should stay the same, ceteris paribus, but allow for
// some slop because V8 mallocs memory during execution.