• Home
  • Raw
  • Download

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>"),
218 tracemalloc.start()
222 snapshot = tracemalloc.take_snapshot()
261 import tracemalloc
263 tracemalloc.start()
268 first_size, first_peak = tracemalloc.get_traced_memory()
270 tracemalloc.reset_peak()
275 second_size, second_peak = tracemalloc.get_traced_memory()
310 Return a :class:`Traceback` instance, or ``None`` if the :mod:`tracemalloc`
321 The :mod:`tracemalloc` module must be tracing memory allocations to
330 :mod:`tracemalloc` module as a tuple: ``(current: int, peak: int)``.
335 Set the peak size of memory blocks traced by the :mod:`tracemalloc` module
338 Do nothing if the :mod:`tracemalloc` module is not tracing memory
353 Get the memory usage in bytes of the :mod:`tracemalloc` module used to store
360 ``True`` if the :mod:`tracemalloc` module is tracing Python memory
381 :mod:`tracemalloc` module. Use the :func:`get_tracemalloc_memory` function
382 to measure how much memory is used by the :mod:`tracemalloc` module.
385 (``PYTHONTRACEMALLOC=NFRAME``) and the :option:`-X` ``tracemalloc=NFRAME``
411 :mod:`tracemalloc` module started to trace memory allocations.
416 The :mod:`tracemalloc` module must be tracing memory allocations to take a
459 * ``Filter(False, tracemalloc.__file__)`` excludes traces of the
460 :mod:`tracemalloc` module
475 tracemalloc uses the domain ``0`` to trace memory allocations made by
695 tracemalloc uses the domain ``0`` to trace memory allocations made by
716 A traceback contains at least ``1`` frame. If the ``tracemalloc`` module
765 tb = tracemalloc.get_object_traceback(f())