tracemalloc.StatisticDiff.count_diff

count_diff Difference of number of memory blocks between the old and the new snapshots (int): 0 if the memory blocks have been allocated in the new snapshot.

tracemalloc.Statistic.count

count Number of memory blocks (int).

tracemalloc.Statistic.size

size Total size of memory blocks in bytes (int).

tracemalloc.StatisticDiff.count

count Number of memory blocks in the new snapshot (int): 0 if the memory blocks have been released in the new snapshot.

tracemalloc.StatisticDiff

class tracemalloc.StatisticDiff Statistic difference on memory allocations between an old and a new Snapshot instance. Snapshot.compare_to() returns a list of StatisticDiff instances. See also the Statistic class. count Number of memory blocks in the new snapshot (int): 0 if the memory blocks have been released in the new snapshot. count_diff Difference of number of memory blocks between the old and the new snapshots (int): 0 if the memory blocks have been allocated in the new snaps

tracemalloc.Snapshot.traces

traces Traces of all memory blocks allocated by Python: sequence of Trace instances. The sequence has an undefined order. Use the Snapshot.statistics() method to get a sorted list of statistics.

tracemalloc.Statistic

class tracemalloc.Statistic Statistic on memory allocations. Snapshot.statistics() returns a list of Statistic instances. See also the StatisticDiff class. count Number of memory blocks (int). size Total size of memory blocks in bytes (int). traceback Traceback where the memory block was allocated, Traceback instance.

tracemalloc.Snapshot.filter_traces()

filter_traces(filters) Create a new Snapshot instance with a filtered traces sequence, filters is a list of Filter instances. If filters is an empty list, return a new Snapshot instance with a copy of the traces. All inclusive filters are applied at once, a trace is ignored if no inclusive filters match it. A trace is ignored if at least one exclusive filter matches it.

tracemalloc.Snapshot.traceback_limit

traceback_limit Maximum number of frames stored in the traceback of traces: result of the get_traceback_limit() when the snapshot was taken.

tracemalloc.Snapshot.statistics()

statistics(group_by: str, cumulative: bool=False) Get statistics as a sorted list of Statistic instances grouped by group_by: group_by description 'filename' filename 'lineno' filename and line number 'traceback' traceback If cumulative is True, cumulate size and count of memory blocks of all frames of the traceback of a trace, not only the most recent frame. The cumulative mode can only be used with group_by equals to 'filename' and 'lineno'. The result is sorted from the biggest to the s