mirror of
https://github.com/python/cpython
synced 2026-09-29 12:10:30 +03:00
Issue #18874: Implement the PEP 454 (tracemalloc)
This commit is contained in:
parent
0fb6072fad
commit
ed3b0bca3e
17 changed files with 4024 additions and 15 deletions
|
|
@ -376,11 +376,15 @@ Miscellaneous options
|
|||
.. cmdoption:: -X
|
||||
|
||||
Reserved for various implementation-specific options. CPython currently
|
||||
defines two possible values:
|
||||
defines the following possible values:
|
||||
|
||||
* ``-X faulthandler`` to enable :mod:`faulthandler`;
|
||||
* ``-X showrefcount`` to enable the output of the total reference count
|
||||
and memory blocks (only works on debug builds);
|
||||
* ``-X tracemalloc`` to enable :mod:`tracemalloc`.
|
||||
* ``-X tracemalloc=NFRAME`` to enable :mod:`tracemalloc`, *NFRAME* is the
|
||||
maximum number of frames stored in a trace: see the
|
||||
:func:`tracemalloc.set_traceback_limit` function.
|
||||
|
||||
It also allows to pass arbitrary values and retrieve them through the
|
||||
:data:`sys._xoptions` dictionary.
|
||||
|
|
@ -392,7 +396,7 @@ Miscellaneous options
|
|||
The ``-X faulthandler`` option.
|
||||
|
||||
.. versionadded:: 3.4
|
||||
The ``-X showrefcount`` option.
|
||||
The ``-X showrefcount`` and ``-X tracemalloc`` options.
|
||||
|
||||
|
||||
Options you shouldn't use
|
||||
|
|
@ -594,6 +598,16 @@ conflict.
|
|||
.. versionadded:: 3.3
|
||||
|
||||
|
||||
.. envvar:: PYTHONTRACEMALLOC
|
||||
|
||||
If this environment variable is set to a non-empty string, all memory
|
||||
allocations made by Python are traced by the :mod:`tracemalloc` module.
|
||||
The value of the variable is the maximum number of frames stored in a trace:
|
||||
see the :func:`tracemalloc.set_traceback_limit` function.
|
||||
|
||||
.. versionadded:: 3.4
|
||||
|
||||
|
||||
Debug-mode variables
|
||||
~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue