mirror of
https://github.com/2234839/web-font.git
synced 2025-04-26 19:46:46 +08:00
21 lines
599 B
JavaScript
21 lines
599 B
JavaScript
// console.log("[global.tjs.engine]", global.tjs.engine.gc.enabled);
|
|
// global.tjs.engine.gc.threshold = 100;
|
|
// console.log("[global.tjs.engine]", global.tjs.engine.gc.threshold);
|
|
|
|
function runGCTests() {
|
|
let objects = [];
|
|
for (let i = 0; i < 100000; i++) {
|
|
objects[i] = { index: i, data: new Array(1000).fill(i) };
|
|
}
|
|
objects = null; // Dereference the objects to make them eligible for garbage collection
|
|
}
|
|
|
|
runGCTests();
|
|
setInterval(() => {
|
|
if (global.tjs) {
|
|
console.log("[global.tjs.engine]", global.tjs.engine.gc.run());
|
|
}
|
|
}, 3000);
|
|
setTimeout(() => {}, 1000000);
|
|
// 168064
|