Re: Memory profiling: Python 3.2

Discussion in 'Python' started by Antoine Pitrou, Nov 2, 2012.

  1. Andrew Robinson <andrew3 <at> r3dsolutions.com> writes:
    >
    > When Python3.2 is running, is there an easy way within Python to capture
    > the *total* amount of heap space the program is actually using (eg:real
    > memory)?


    I'm not sure what you mean with "real memory" or how precise you want that
    measurement to be, but you could try http://www.selenic.com/smem/
    (and, within Python, re-use smem's concepts, which shouldn't be too difficult)

    > And how much of that heap space is allocated to variables (
    > including re-capturable data not yet GC'd ) ?


    Again, not sure what you mean with "allocated to variables" (global variables?
    local variables? everything?). As for "re-capturable data not yet GC'd", the
    best way to figure out is to run gc.collect() :)

    Regards

    Antoine.
     
    Antoine Pitrou, Nov 2, 2012
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. dayjah
    Replies:
    3
    Views:
    12,767
  2. Rune Froysa

    Memory profiling

    Rune Froysa, Sep 24, 2003, in forum: Python
    Replies:
    1
    Views:
    389
    Michael Hudson
    Sep 25, 2003
  3. Eddie

    profiling memory usage

    Eddie, Oct 6, 2006, in forum: Python
    Replies:
    3
    Views:
    356
    NOSHII
    Oct 6, 2006
  4. Ram  Prasad

    OT: Memory profiling on Linux

    Ram Prasad, May 1, 2007, in forum: C Programming
    Replies:
    5
    Views:
    403
    Giorgos Keramidas
    May 2, 2007
  5. Andrew Robinson

    Memory profiling: Python 3.2

    Andrew Robinson, Nov 2, 2012, in forum: Python
    Replies:
    0
    Views:
    184
    Andrew Robinson
    Nov 2, 2012
Loading...

Share This Page