Skip to main content Brad's PyNotes

Posts on Memory

  1. gc Module - Garbage Collection Control

    TL;DR

    The gc module provides an interface to Python’s garbage collector, allowing you to manually trigger collection, disable automatic collection, debug memory leaks, and tune performance. It’s particularly useful for finding reference cycles, optimizing memory usage in long-running processes, and understanding what objects are consuming memory.