mirror of
https://github.com/nodejs/node.git
synced 2025-05-11 17:55:31 +00:00

Always use `process.config.variables.asan`. This removes the need for a special ASAN env var. PR-URL: https://github.com/nodejs/node/pull/52430 Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com> Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com> Reviewed-By: Mohammed Keyvanzadeh <mohammadkeyvanzade94@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io>
34 lines
865 B
JavaScript
34 lines
865 B
JavaScript
'use strict';
|
|
// Flags: --expose-gc
|
|
|
|
const common = require('../common');
|
|
|
|
// On IBMi, the rss memory always returns zero
|
|
if (common.isIBMi)
|
|
common.skip('On IBMi, the rss memory always returns zero');
|
|
|
|
const v8 = require('v8');
|
|
|
|
const before = process.memoryUsage.rss();
|
|
|
|
for (let i = 0; i < 1000000; i++) {
|
|
v8.serialize('');
|
|
}
|
|
|
|
async function main() {
|
|
await common.gcUntil('RSS should go down', () => {
|
|
const after = process.memoryUsage.rss();
|
|
if (common.isASan) {
|
|
console.log(`ASan: before=${before} after=${after}`);
|
|
return after < before * 10;
|
|
} else if (process.config.variables.node_builtin_modules_path) {
|
|
console.log(`node_builtin_modules_path: before=${before} after=${after}`);
|
|
return after < before * 10;
|
|
}
|
|
console.log(`before=${before} after=${after}`);
|
|
return after < before * 10;
|
|
});
|
|
}
|
|
|
|
main();
|