function
jsc.fullGC
Runs a full garbage collection synchronously: every object in the heap is visited, and everything unreachable becomes garbage. Compare edenGC, which only looks at recent allocations.
The garbage's memory is reclaimed lazily as the heap is swept afterwards; gcAndSweep also does the sweep before returning.
Unlike Bun.gc(true), this does not release the targets of WeakRefs (releaseWeakRefs) and does not touch memory outside the JavaScript heap.
@returns
The size of the heap in bytes after the collection, as heapSize measures it