MCPcopy Index your code
hub / github.com/python/cpython / take_snapshot

Function take_snapshot

Lib/tracemalloc.py:551–560  ·  view source on GitHub ↗

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

()

Source from the content-addressed store, hash-verified

549
550
551def take_snapshot():
552 """
553 Take a snapshot of traces of memory blocks allocated by Python.
554 """
555 if not is_tracing():
556 raise RuntimeError("the tracemalloc module must be tracing memory "
557 "allocations to take a snapshot")
558 traces = _get_traces()
559 traceback_limit = get_traceback_limit()
560 return Snapshot(traces, traceback_limit)

Callers

nothing calls this directly

Calls 1

SnapshotClass · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…