sdk/python/Developer Tools/PyTracemalloc
Developer Tools

PyTracemalloc

Python stdlib module — tracemalloc. Auto-indexed from CDN. Method-level security roles have not been annotated; rule writers should inspect the source before use.

Other Methods

.clear_traces()Neutral
#
Signature
clear_traces()

Clear traces of memory blocks allocated by Python.

.get_object_traceback()Neutral
#
Signature
get_object_traceback(obj)

Get the traceback where the Python object *obj* was allocated.

.get_traceback_limit()Neutral
#
Signature
get_traceback_limit()

Get the maximum number of frames stored in the traceback of a trace.

.get_traced_memory()Neutral
#
Signature
get_traced_memory()

Get the current size and peak size of memory blocks traced by tracemalloc.

.get_tracemalloc_memory()Neutral
#
Signature
get_tracemalloc_memory()

Get the memory usage in bytes of the tracemalloc module.

.is_tracing()Neutral
#
Signature
is_tracing()

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

.reset_peak()Neutral
#
Signature
reset_peak()

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

.start()Neutral
#
Signature
start(nframe)

Start tracing Python memory allocations.

.stop()Neutral
#
Signature
stop()

Stop tracing Python memory allocations.

.take_snapshot()Neutral
#
Signature
take_snapshot()

Take a snapshot of traces of memory blocks allocated by Python.

Fully-Qualified Names

FQNField
tracemallocfqns[0]

Wrong FQN → 0 findings. Verify with: change fqns to garbage → must produce 0 results.

Import

rule.py
import tracemalloc