node/test/fixtures/gc.js
Tony Gorez 00cb0912ef
test: add trace-gc flag test
PR-URL: https://github.com/nodejs/node/pull/42471
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Darshan Sen <raisinten@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
2022-03-28 21:15:08 +01:00

10 lines
198 B
JavaScript

let arr = new Array(300_000).fill('a');
for (let index = 0; index < arr.length; index++) {
arr[index] = Math.random();
}
arr = [];
// .gc() is called to generate a Mark-sweep event
global.gc();