On this page
tracemalloc.reset_peak
Prev: tracemalloc.Iterable | Up: tracemalloc | Next: tracemalloc.Sequence
Rel: tracemalloc.BaseFilter, tracemalloc.clear_traces, tracemalloc.DomainFilter, tracemalloc.Filter
Ref: docs.python.org — tracemalloc.reset_peak
Tags: #public #python3 #stdlib #tracemalloc
Import
import tracemalloc
from tracemalloc import reset_peak
Signature & Overview
tracemalloc.reset_peak()
Set the peak size of memory blocks traced by tracemalloc to the current size.
Usage
import tracemalloc
tracemalloc.start()
try:
tracemalloc.reset_peak()
cur, peak = tracemalloc.get_traced_memory()
assert peak >= cur
finally:
tracemalloc.stop()
Gotchas
- Resets the peak high-water mark to the current traced memory before benchmarking a phase.
REPL Inspect
from tracemalloc import reset_peak
help(reset_peak)
Linked from
Related notes
- tuts/python3/stdlib_module/tracemalloc/Iterable Linked here; links to this page; shared tags: #stdlib, #tracemalloc
- tuts/python3/stdlib_module/tracemalloc/Sequence 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/Frame shared tags: #stdlib, #tracemalloc
- tuts/python3/stdlib_module/tracemalloc/get_object_traceback shared tags: #stdlib, #tracemalloc
- tuts/python3/stdlib_module/tracemalloc/get_traceback_limit shared tags: #stdlib, #tracemalloc