[Python-Dev] Updated PEP 454 (tracemalloc): no more metrics!

Kristján Valur Jónsson kristjan at ccpgames.com
Wed Oct 30 13:37:48 CET 2013


> -----Original Message-----
> From: Victor Stinner [mailto:victor.stinner at gmail.com]
> Sent: 29. október 2013 21:30
> To: Kristján Valur Jónsson
> Cc: python-dev
> Subject: Re: [Python-Dev] Updated PEP 454 (tracemalloc): no more metrics!
> tracemalloc maintains a dictionary of all allocated memory blocks, which is
> slow and eats a lot of memory. You don't need tracemalloc to log calls to
> malloc/realloc/free. You can write your own hook using the PEP 445 (malloc
> API). A code just writing to stderr should not be longer than 100 linues
> (tracemalloc is closer to 2500 lines).
> 

The point of a PEP is getting something into standard python.  The command line flag is also part of this.
Piggybacking a lightweight client/server data-gathering version of this on top of the PEP
could be beneficial in that respect. 

Unless I am mistaken, the Pep 445 hooks must be setup before calling Py_Initialize() and so using
them is not trivial.

Anyway, just a suggestion, for the record.

K


More information about the Python-Dev mailing list