On this page
  1. gc.get_stats
  2. Import
  3. Signature & Overview
  4. Usage
  5. Gotchas
  6. REPL Inspect

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

REPL Inspect

from gc import get_stats
help(get_stats)

Linked from

Related notes