GC Debug Flags: Uncovering Collection Details & Uncollectable Objects

The `gc.set_debug()` function with flags like `gc.DEBUG_STATS` or `gc.DEBUG_UNCOLLECTABLE` provides detailed printouts of GC runs, including collection counts, durations, and objects that couldn't be collected due to remaining references.

Sources

Open the full topic