[Python-checkins] peps: PEP 454: cleanup
victor.stinner
python-checkins at python.org
Mon Nov 4 08:51:55 CET 2013
http://hg.python.org/peps/rev/a5d89a8b66fe
changeset: 5249:a5d89a8b66fe
user: Victor Stinner <victor.stinner at gmail.com>
date: Mon Nov 04 08:50:35 2013 +0100
summary:
PEP 454: cleanup
files:
pep-0454.txt | 50 ++++++++++++++++++++--------------------
1 files changed, 25 insertions(+), 25 deletions(-)
diff --git a/pep-0454.txt b/pep-0454.txt
--- a/pep-0454.txt
+++ b/pep-0454.txt
@@ -134,17 +134,6 @@
See also ``start()`` and ``stop()`` functions.
-``start()`` function:
-
- Start tracing Python memory allocations.
-
- The function installs hooks on Python memory allocators. These hooks
- have important overhead in term of performances and memory usage:
- see `Filter functions`_ to limit the overhead.
-
- See also ``stop()`` and ``is_tracing()`` functions.
-
-
``stop()`` function:
Stop tracing Python memory allocations and clear traces of memory
@@ -159,13 +148,24 @@
See also ``start()`` and ``is_tracing()`` functions.
+``start()`` function:
+
+ Start tracing Python memory allocations.
+
+ The function installs hooks on Python memory allocators. These hooks
+ have important overhead in term of performances and memory usage:
+ see `Filter functions`_ to limit the overhead.
+
+ See also ``stop()`` and ``is_tracing()`` functions.
+
+
``take_snapshot()`` function:
Take a snapshot of traces of memory blocks allocated by Python using
the ``get_traces()`` function. Return a new ``Snapshot`` instance.
- The ``tracemalloc`` module must be tracing memory allocations to take a
- snapshot, see the the ``start()`` function.
+ The ``tracemalloc`` module must be tracing memory allocations to
+ take a snapshot, see the the ``start()`` function.
See also ``get_traces()`` and ``get_object_traceback()`` functions.
@@ -175,7 +175,7 @@
When Python allocates a memory block, ``tracemalloc`` attachs a "trace" to
the memory block to store its size in bytes and the traceback where the
-allocation occured.
+allocation occurred.
The following functions give access to these traces. A trace is a ``(size: int,
traceback)`` tuple. *size* is the size of the memory block in bytes.
@@ -208,8 +208,8 @@
Get the maximum number of frames stored in the traceback of a trace.
- By default, a trace of an allocated memory block only stores the
- most recent frame: the limit is ``1``.
+ By default, a trace of a memory block only stores the most recent
+ frame: the limit is ``1``.
Use the ``set_traceback_limit()`` function to change the limit.
@@ -220,19 +220,19 @@
``(size: int, traceback: tuple)`` tuples. *traceback* is a tuple of
``(filename: str, lineno: int)`` tuples.
- The list of traces do not include memory blocks allocated before the
- ``tracemalloc`` module started to trace memory allocations nor memory
- blocks ignored by filters (see ``get_filters()``).
+ The list of traces does not include memory blocks allocated before
+ the ``tracemalloc`` module started to trace memory allocations nor
+ memory blocks ignored by filters (see ``get_filters()``).
- The list is not sorted. Take a snapshot using ``take_snapshot()``
- and use the ``Snapshot.statistics()`` method to get a sorted list of
- statistics.
+ The list has an undefined order. Take a snapshot using
+ ``take_snapshot()`` and use the ``Snapshot.statistics()`` method to
+ get a sorted list of statistics.
Tracebacks of traces are limited to ``traceback_limit`` frames. Use
``set_traceback_limit()`` to store more frames.
- Return an empty list if the ``tracemalloc`` module is not tracing memory
- allocations.
+ Return an empty list if the ``tracemalloc`` module is not tracing
+ memory allocations.
See also ``take_snapshot()`` and ``get_object_traceback()``
functions.
@@ -266,7 +266,7 @@
To limit the overhead, some files can be excluded or tracing can be restricted
to a set of files using filters. Examples: ``add_filter(Filter(True,
subprocess.__file__))`` only traces memory allocations in the ``subprocess``
-module, and ``add_filter(Filter(False, tracemalloc.__file__))`` do not trace
+module, and ``add_filter(Filter(False, tracemalloc.__file__))`` ignores
memory allocations in the ``tracemalloc`` module
By default, there is one exclusive filter to ignore Python memory blocks
--
Repository URL: http://hg.python.org/peps
More information about the Python-checkins
mailing list