fix: optimize quick js runtime

This commit is contained in:
sanish-bruno
2025-12-11 13:41:53 +05:30
parent f6e2279fe3
commit 60d5d5e98d
5 changed files with 167 additions and 12 deletions

View File

@@ -807,7 +807,17 @@ const handler = async function (argv) {
}
}
// Cleanup: Clear hook managers map (will be garbage collected)
// Cleanup: Dispose all HookManagers to free VM resources, then clear the map
// This is critical to prevent memory leaks from persisted QuickJS VMs
hookManagersMap.forEach((hookManager) => {
if (hookManager && typeof hookManager.dispose === 'function') {
try {
hookManager.dispose();
} catch (e) {
// Ignore disposal errors
}
}
});
hookManagersMap.clear();
const summary = printRunSummary(results);