Skip to content

Commit 0fabd8e

Browse files
Trotttargos
authored andcommitted
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>
1 parent 64fb928 commit 0fabd8e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

test/pummel/test-vm-memleak.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
// USE OR OTHER DEALINGS IN THE SOFTWARE.
2121

2222
'use strict';
23-
// Flags: --max_old_space_size=32
23+
// Flags: --max_old_space_size=32 --expose_gc
2424

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

@@ -39,6 +39,7 @@ const interval = setInterval(function() {
3939
} catch {
4040
}
4141

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

0 commit comments

Comments
 (0)