On this page
tracemalloc.get_object_traceback
Prev: tracemalloc.Frame | Up: tracemalloc | Next: tracemalloc.get_traceback_limit
Rel: tracemalloc.BaseFilter, tracemalloc.clear_traces, tracemalloc.DomainFilter, tracemalloc.Filter
Ref: docs.python.org — tracemalloc.get_object_traceback
Tags: #public #python3 #stdlib #tracemalloc
Import
import tracemalloc
from tracemalloc import get_object_traceback
Signature & Overview
tracemalloc.get_object_traceback(obj)
Get the traceback where the Python object obj was allocated.
Usage
import tracemalloc
tracemalloc.start()
try:
data = [1, 2, 3]
tb = tracemalloc.get_object_traceback(data)
assert tb is not None and len(tb) >= 1
finally:
tracemalloc.stop()
Gotchas
- Returns
Noneifobjwas allocated beforetracemalloc.start().
REPL Inspect
from tracemalloc import get_object_traceback
help(get_object_traceback)
Linked from
Related notes
- tuts/python3/stdlib_module/tracemalloc/Frame Linked here; links to this page; shared tags: #stdlib, #tracemalloc
- tuts/python3/stdlib_module/tracemalloc/get_traceback_limit Linked here; links to this page; shared tags: #stdlib, #tracemalloc
- tuts/python3/stdlib_module/tracemalloc Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/tracemalloc/BaseFilter Linked here; shared tags: #stdlib, #tracemalloc
- tuts/python3/stdlib_module/tracemalloc/clear_traces Linked here; shared tags: #stdlib, #tracemalloc
- tuts/python3/stdlib_module/tracemalloc/DomainFilter Linked here; shared tags: #stdlib, #tracemalloc
- tuts/python3/stdlib_module/tracemalloc/Filter Linked here; shared tags: #stdlib, #tracemalloc
- tuts/python3/stdlib_module/tracemalloc/get_traced_memory shared tags: #stdlib, #tracemalloc
- tuts/python3/stdlib_module/tracemalloc/get_tracemalloc_memory shared tags: #stdlib, #tracemalloc
- tuts/python3/stdlib_module/tracemalloc/is_tracing shared tags: #stdlib, #tracemalloc