mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-23 06:10:02 +08:00
When the main thread's script ends, the executable released every module global and ran a full cycle collection before exiting, which takes time proportional to everything the program still holds (about 15 ms for 1.5 million live objects) and frees memory the operating system reclaims anyway. The main thread now skips those releases, the exit-time collection and the collector's buffer cleanup. Exit listeners and output flushing run as before. Worker threads still free their heaps when they exit, since later threads reuse their arenas, and builds that check for leaks (the RC audit, AddressSanitizer) free everything as before, as does any process run with SCRIPTC_EXIT_FREE=1 for external leak checkers. SCRIPTC_WORKER_STATS=1 reports, as each worker thread exits, how long it took to start, to run its script and to exit.