PyDocs

Debugging and profiling

tracemalloc

The tracemalloc module is a debug tool to trace memory blocks allocated by Python. It provides the following information:
Symbols in tracemalloc

c

clear_traces
Clear traces of memory blocks allocated by Python.

d

DomainFilter
Filter traces of memory blocks by their address space (domain).

f

Filter
Filter on traces of memory blocks.
Frame
Frame of a traceback.

g

get_object_traceback
Get the traceback where the Python object *obj* was allocated.
get_traceback_limit
Get the maximum number of frames stored in the traceback of a trace.
get_traced_memory
Get the current size and peak size of memory blocks traced by tracemalloc.
get_tracemalloc_memory
Get the memory usage in bytes of the tracemalloc module.

i

is_tracing
Return True if the tracemalloc module is tracing Python memory allocations.

r

reset_peak
Set the peak size of memory blocks traced by tracemalloc to the current size.

s

Snapshot
Snapshot of traces of memory blocks allocated by Python.
start
Start tracing Python memory allocations.
Statistic
Statistic difference on memory allocations between two Snapshot instance.
StatisticDiff
Statistic difference on memory allocations between an old and a new Snapshot instance.
stop
Stop tracing Python memory allocations.

t

take_snapshot
Take a snapshot of traces of memory blocks allocated by Python.
Trace
Trace of a memory block.
Traceback
Sequence of Frame instances sorted from the oldest frame to the most recent frame.