[Python-Dev] PEP 454: tracemalloc (n-th version)

Victor Stinner victor.stinner at gmail.com
Sun Nov 3 14:34:48 CET 2013

"n-th version": Sorry, I don't remember the version number of the PEP :-)


Lastest changes:

* rename disable/enable/is_enabled() to stop/start/is_tracing()
* Snapshot.apply_filters() now returns a new Snapshot instance
* a traceback now always contains a least 1 frame, use (('<unknown>', 0),) if
  the traceback cannot read or if the traceback limit is 0
* Rename Filter.traceback to Filter.all_frames
* write more documentation on filter functions

Charles-François doesn't look convinced that disabling temporarily
tracing is useful, me neither. Another concern is that it is not
possible to disable completly tracing, only disable tracing new
allocations, deallocations are still tracing. I chose a simpler API
with limitations.

The PEP is not *completly* different than my first proposition. Even
if the latest PEP has fewer functions and classes, it's almost as
powerful. I replaced complex classes and high-level API with short
examples in the documentation:


For the implementation of tracemalloc, see:


Rietveld link to the latest patch:



More information about the Python-Dev mailing list