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

Kristján Valur Jónsson kristjan at ccpgames.com
Thu Oct 24 16:40:25 CEST 2013



> -----Original Message-----
> From: Nick Coghlan [mailto:ncoghlan at gmail.com]
> Sent: 24. október 2013 12:44
> To: Kristján Valur Jónsson
> Cc: Python Dev
> Subject: Re: [Python-Dev] Updated PEP 454 (tracemalloc): no more metrics!
> Not everything is a PC that you can just add more memory to (or switch to a
> lab server with the same CPU architecture but more RAM).
> 
> If Victor were only interested in analysing x86[_64] software, I'd agree with
> you, but embedded scenarios don't always offer that freedom to do
> resource consumption analysis on a more powerful system.
> 
Indeed not.
In fact, I was faced with the same problem when developing for the PS3.
My solution was to not do it.  The memory profiler running on the PS3
performs no analysis whatsoever.  For every operation (malloc/realloc/free) it
simply records the address and the traceback and sends it along its merry way
to a server which is listening on a TCP or UDP port

If anyone is interested in adding that functionality to tracemalloc, I can contribute
my code as an example.
A corresponding server is a pure-python affair.

An added benefit of a client-server approach is that there the memory profiling
tool is non-intrusive (apart from slowing down the execution either due to
cpu or network blockage) and so has to take no special steps to exclude itself from the profiling.

K




More information about the Python-Dev mailing list