mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
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: https://github.com/nodejs/node/pull/34289 PR-URL: https://github.com/nodejs/node/pull/38054 Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This commit is contained in:
parent
2861778ecd
commit
4f387c25cb
@ -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');
|
||||
@ -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)`);
|
||||
|
Loading…
Reference in New Issue
Block a user