Lines Matching refs:tracemalloc
1 :mod:`tracemalloc` --- Trace memory allocations
4 .. module:: tracemalloc
9 **Source code:** :source:`Lib/tracemalloc.py`
13 The tracemalloc module is a debug tool to trace memory blocks allocated by
23 variable to ``1``, or by using :option:`-X` ``tracemalloc`` command line
24 option. The :func:`tracemalloc.start` function can be called at runtime to
30 :option:`-X` ``tracemalloc=25`` command line option.
41 import tracemalloc
43 tracemalloc.start()
47 snapshot = tracemalloc.take_snapshot()
81 import tracemalloc
82 tracemalloc.start()
85 snapshot1 = tracemalloc.take_snapshot()
87 snapshot2 = tracemalloc.take_snapshot()
125 import tracemalloc
128 tracemalloc.start(25)
132 snapshot = tracemalloc.take_snapshot()
193 import tracemalloc
197 tracemalloc.Filter(False, "<frozen importlib._bootstrap>"),
198 tracemalloc.Filter(False, "<unknown>"),
220 tracemalloc.start()
224 snapshot = tracemalloc.take_snapshot()
271 Return a :class:`Traceback` instance, or ``None`` if the :mod:`tracemalloc`
282 The :mod:`tracemalloc` module must be tracing memory allocations to
291 :mod:`tracemalloc` module as a tuple: ``(current: int, peak: int)``.
296 Get the memory usage in bytes of the :mod:`tracemalloc` module used to store
303 ``True`` if the :mod:`tracemalloc` module is tracing Python memory
321 :mod:`tracemalloc` module. Use the :func:`get_tracemalloc_memory` function
322 to measure how much memory is used by the :mod:`tracemalloc` module.
325 (``PYTHONTRACEMALLOC=NFRAME``) and the :option:`-X` ``tracemalloc=NFRAME``
351 :mod:`tracemalloc` module started to trace memory allocations.
356 The :mod:`tracemalloc` module must be tracing memory allocations to take a
399 * ``Filter(False, tracemalloc.__file__)`` excludes traces of the
400 :mod:`tracemalloc` module
415 tracemalloc uses the domain ``0`` to trace memory allocations made by
635 tracemalloc uses the domain ``0`` to trace memory allocations made by
656 A traceback contains at least ``1`` frame. If the ``tracemalloc`` module
693 tb = tracemalloc.get_object_traceback(f())