On this page
gc.get_stats
Prev: gc.get_referrers | Up: gc | Next: gc.get_threshold
Rel: gc.collect, gc.disable, gc.enable, gc.freeze
Ref: docs.python.org — gc.get_stats
Tags: #public #python3 #stdlib #gc
Import
import gc
from gc import get_stats
Signature & Overview
gc.get_stats()
Return a list of dictionaries containing per-generation statistics.
Usage
import gc
stats = gc.get_stats()
assert len(stats) == 3 and "collections" in stats[0]
Gotchas
- Returns a list of 3 dicts (one per generation) with
collections,collected, anduncollectablecounts.
REPL Inspect
from gc import get_stats
help(get_stats)
Linked from
Related notes
- tuts/python3/stdlib_module/gc/get_referrers Linked here; links to this page; shared tags: #gc, #stdlib
- tuts/python3/stdlib_module/gc/get_threshold Linked here; links to this page; shared tags: #gc, #stdlib
- tuts/python3/stdlib_module/gc Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/gc/collect Linked here; shared tags: #gc, #stdlib
- tuts/python3/stdlib_module/gc/disable Linked here; shared tags: #gc, #stdlib
- tuts/python3/stdlib_module/gc/enable Linked here; shared tags: #gc, #stdlib
- tuts/python3/stdlib_module/gc/freeze Linked here; shared tags: #gc, #stdlib
- tuts/python3/stdlib_module/gc/get_count shared tags: #gc, #stdlib
- tuts/python3/stdlib_module/gc/get_debug shared tags: #gc, #stdlib
- tuts/python3/stdlib_module/gc/get_freeze_count shared tags: #gc, #stdlib