Inspect GC activity when memory grows unexpectedly.

Section: Memory Growth

Show garbage collector stats

python
python
import gc

print(gc.get_count())
print(gc.get_stats())

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Memory Growth
Force a garbage collection cycle
Useful for experiments while diagnosing leaks.
OpenIn sheetpythonsame section
Show import statements as they happen
Print detailed import resolution activity.
Save cProfile output to a file
Store profile stats for later analysis.
Print site-package configuration
Inspect interpreter paths and site initialization.
Inspect saved profile stats
Read and sort a saved profile run.