gc

Bun

Symbol

gc

function gc(force: boolean): void

Manually trigger the garbage collector

This does two things:

  1. It tells JavaScriptCore to run the garbage collector
  2. It tells mimalloc to clean up fragmented memory. Mimalloc manages the heap not used in JavaScriptCore.
@param force

Synchronously run the garbage collector