PEP 454: copy missing part of the doc

This commit is contained in:
Victor Stinner 2013-10-23 20:12:42 +02:00
parent f218dd187d
commit 2f7a3f3957
1 changed files with 17 additions and 0 deletions

View File

@ -88,6 +88,23 @@ implementations of Python may not be able to provide it.
API
===
To trace most memory blocks allocated by Python, the module should be
enabled as early as possible by setting the ``PYTHONTRACEMALLOC``
environment variable to ``1``, or by using ``-X tracemalloc`` command
line option. The ``tracemalloc.enable()`` function can be called at
runtime to start tracing Python memory allocations.
By default, a trace of an allocated memory block only stores the most
recent frame (1 frame). To store 25 frames at startup: set the
``PYTHONTRACEMALLOC`` environment variable to ``25``, or use the ``-X
tracemalloc=25`` command line option. The ``set_traceback_limit()``
function can be used at runtime to set the limit.
By default, Python memory blocks allocated in the ``tracemalloc`` module
are ignored using a filter. Use ``clear_filters()`` to trace also these
memory allocations.
Main Functions
--------------