Re: [Python-Dev] Add a new tracemalloc module to trace memory allocations

2013-09-05 Thread Victor Stinner
2013/8/31 Gregory P. Smith : > Think of the possibilities, you could even setup a test runner to > enable/disable before and after each test, test suite or test module to > gather narrow statistics as to what code actually _caused_ the allocations > rather than the ultimate individual file/line doi

Re: [Python-Dev] Add a new tracemalloc module to trace memory allocations

2013-09-05 Thread Victor Stinner
2013/9/1 Nick Coghlan : > +1 from me for both tracemalloc and failmalloc in the same vein as > faulthandler (and using similar API concepts to faulthandler). > > While I like the flat top level naming structure, we should clearly document > these as implementation dependent runtime services. Other

Re: [Python-Dev] Add a new tracemalloc module to trace memory allocations

2013-09-02 Thread Antoine Pitrou
Le Sun, 1 Sep 2013 11:36:51 +1000, Nick Coghlan a écrit : > +1 from me for both tracemalloc and failmalloc in the same vein as > faulthandler (and using similar API concepts to faulthandler). > > While I like the flat top level naming structure, we should clearly > document these as implementatio

Re: [Python-Dev] Add a new tracemalloc module to trace memory allocations

2013-08-31 Thread Nick Coghlan
+1 from me for both tracemalloc and failmalloc in the same vein as faulthandler (and using similar API concepts to faulthandler). While I like the flat top level naming structure, we should clearly document these as implementation dependent runtime services. Other implementations may not provide t

Re: [Python-Dev] Add a new tracemalloc module to trace memory allocations

2013-08-31 Thread Victor Stinner
Le 31 août 2013 19:09, "Gregory P. Smith" a écrit : > First, I really like this. +1 Current votes: +3 (i also want tracemalloc!). No opposition against such addition. > We should be consistent with faulthandler's options. Why do you not want to support both the env var and enable()/disable() fu

Re: [Python-Dev] Add a new tracemalloc module to trace memory allocations

2013-08-31 Thread Charles-François Natali
2013/8/29 Victor Stinner : > Charles-François Natali and Serhiy Storchaka asked me to add this > module somewhere in Python 3.4: "how about adding pyfailmalloc to the > main repo (maybe under Tools), with a script making it easy to run the > tests suite with it enabled?" There are two reasons I th

Re: [Python-Dev] Add a new tracemalloc module to trace memory allocations

2013-08-31 Thread Gregory P. Smith
First, I really like this. +1 On Wed, Aug 28, 2013 at 6:07 PM, Victor Stinner wrote: > 2013/8/29 Victor Stinner : > > My proposed implementation for Python 3.4 is different: > > > > * no enable() / disable() function: tracemalloc can only be enabled > > before startup by setting PYTHONTRACEMALLO

Re: [Python-Dev] Add a new tracemalloc module to trace memory allocations

2013-08-29 Thread Victor Stinner
2013/8/29 Brett Cannon : >> I also created a "pyfailmalloc" project based on the PEP 445 to inject >> MemoryError exceptions. (...) > > Would extension module authors find it useful? I don't know, I created two months ago and I didn't made a public annoucement. > If so maybe we need a malloc pack

Re: [Python-Dev] Add a new tracemalloc module to trace memory allocations

2013-08-29 Thread Brett Cannon
On Wed, Aug 28, 2013 at 8:16 PM, Victor Stinner wrote: > Hi, > > Thanks to the PEP 445, it becomes possible to trace easily memory > allocations. I propose to add a new tracemalloc module computing the > memory usage per file and per line number. It has also a private > method to retrieve the loca

Re: [Python-Dev] Add a new tracemalloc module to trace memory allocations

2013-08-28 Thread Victor Stinner
2013/8/29 Victor Stinner : > My proposed implementation for Python 3.4 is different: > > * no enable() / disable() function: tracemalloc can only be enabled > before startup by setting PYTHONTRACEMALLOC=1 environment variable > > * traces (size of the memory block, Python filename, Python line > nu