Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
test: fix flaky test-vm-memleak
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 <targos@protonmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
  • Loading branch information
Trott committed Apr 5, 2021
commit 4f387c25cb60ad556fce058546a52f905c3e9d51
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

require('../common');
const assert = require('assert');
Expand All @@ -34,6 +34,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