💾 Archived View for tris.fyi › pydoc › tracemalloc captured on 2022-07-16 at 14:58:17. Gemini links have been rewritten to link to archived content
⬅️ Previous capture (2022-04-28)
-=-=-=-=-=-=-
This module has no docstring.
domain = <property object at 0x7f92bd69df90>
filename_pattern = <property object at 0x7f92bd69def0>
Frame of a traceback.
filename = <property object at 0x7f92bd69dbd0>
lineno = <property object at 0x7f92bd69db80>
All the operations on a read-only sequence. Concrete subclasses must override __new__ or __init__, __getitem__, and __len__.
count(self, value) S.count(value) -> integer -- return number of occurrences of value
index(self, value, start=0, stop=None) S.index(value, [start, [stop]]) -> integer -- return first index of value. Raises ValueError if the value is not present. Supporting start and stop arguments is optional, but recommended.
Snapshot of traces of memory blocks allocated by Python.
compare_to(self, old_snapshot, key_type, cumulative=False) Compute the differences with an old snapshot old_snapshot. Get statistics as a sorted list of StatisticDiff instances, grouped by group_by.
dump(self, filename) Write the snapshot into a file.
filter_traces(self, filters) Create a new Snapshot instance with a filtered traces sequence, filters is a list of Filter or DomainFilter instances. If filters is an empty list, return a new Snapshot instance with a copy of the traces.
load(filename) Load a snapshot from a file.
statistics(self, key_type, cumulative=False) Group statistics by key_type. Return a sorted list of Statistic instances.
Statistic difference on memory allocations between two Snapshot instance.
count = <member 'count' of 'Statistic' objects>
size = <member 'size' of 'Statistic' objects>
traceback = <member 'traceback' of 'Statistic' objects>
Statistic difference on memory allocations between an old and a new Snapshot instance.
count = <member 'count' of 'StatisticDiff' objects>
count_diff = <member 'count_diff' of 'StatisticDiff' objects>
size = <member 'size' of 'StatisticDiff' objects>
size_diff = <member 'size_diff' of 'StatisticDiff' objects>
traceback = <member 'traceback' of 'StatisticDiff' objects>
Trace of a memory block.
domain = <property object at 0x7f92bd69dd10>
size = <property object at 0x7f92bd69dd60>
traceback = <property object at 0x7f92bd69ddb0>
Sequence of Frame instances sorted from the oldest frame to the most recent frame.
count(self, value) S.count(value) -> integer -- return number of occurrences of value
format(self, limit=None, most_recent_first=False)
index(self, value, start=0, stop=None) S.index(value, [start, [stop]]) -> integer -- return first index of value. Raises ValueError if the value is not present. Supporting start and stop arguments is optional, but recommended.
total_nframe = <property object at 0x7f92bd69dc70>
clear_traces() Clear traces of memory blocks allocated by Python.
get_object_traceback(obj) Get the traceback where the Python object *obj* was allocated. Return a Traceback instance. Return None if the tracemalloc module is not tracing memory allocations or did not trace the allocation of the object.
get_traceback_limit() Get the maximum number of frames stored in the traceback of a trace. By default, a trace of an allocated memory block only stores the most recent frame: the limit is 1.
get_traced_memory() Get the current size and peak size of memory blocks traced by tracemalloc. Returns a tuple: (current: int, peak: int).
get_tracemalloc_memory() Get the memory usage in bytes of the tracemalloc module. This memory is used internally to trace memory allocations.
is_tracing() Return True if the tracemalloc module is tracing Python memory allocations.
reset_peak() Set the peak size of memory blocks traced by tracemalloc to the current size. Do nothing if the tracemalloc module is not tracing memory allocations.
start(nframe=1, /) Start tracing Python memory allocations. Also set the maximum number of frames stored in the traceback of a trace to nframe.
stop() Stop tracing Python memory allocations. Also clear traces of memory blocks allocated by Python.
take_snapshot() Take a snapshot of traces of memory blocks allocated by Python.
total_ordering(cls) Class decorator that fills in missing ordering methods