Skip to content

Commit

Permalink
test: fix flaky test-vm-memleak
Browse files Browse the repository at this point in the history
Force garbage collection so that the memory leak is more easily
differentiated from ordinary not-garbage-collected memory.

Refs: #34289

PR-URL: #38054
Reviewed-By: Michaël Zasso <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
  • Loading branch information
Trott authored and targos committed Sep 7, 2021
1 parent 64fb928 commit 0fabd8e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion test/pummel/test-vm-memleak.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
// USE OR OTHER DEALINGS IN THE SOFTWARE.

'use strict';
// Flags: --max_old_space_size=32
// Flags: --max_old_space_size=32 --expose_gc

const common = require('../common');

Expand All @@ -39,6 +39,7 @@ const interval = setInterval(function() {
} catch {
}

global.gc();
const rss = process.memoryUsage.rss();
assert.ok(rss < 64 * 1024 * 1024,
`memory usage: ${rss} (${Math.round(rss / (1024 * 1024))} MB)`);
Expand Down

0 comments on commit 0fabd8e

Please sign in to comment.