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 James M Snell committed 2021-01-11 11:37:03 -08:00
1 parent 2ceb44120b
commit f4ef517deb
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.