how to measure memory usage on Mac OSX ?

Discussion in 'Python' started by masayuki.takagi, Feb 26, 2008.

  1. hi all,

    i want to measure memory usage of my python process on Mac OSX.

    i tired resource module, but it doesn't work on OSX.

    how can i get it ?

    thnx.


    -- masayuki takagi
    masayuki.takagi, Feb 26, 2008
    #1
    1. Advertising

  2. masayuki.takagi

    7stud Guest

    On Feb 26, 3:43 am, "masayuki.takagi" <> wrote:
    > hi all,
    >
    > i want to measure memory usage of my python process on Mac OSX.
    >
    > i tired resource module, but it doesn't work on OSX.
    >
    > how can i get it ?
    >
    > thnx.
    >
    > -- masayuki takagi


    #mac osx 10.4.7
    import resource

    print resource.getrusage(resource.RUSAGE_SELF)

    --output:--
    (0.009417, 0.020122999999999999, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0,
    0, 0)
    7stud, Feb 26, 2008
    #2
    1. Advertising

  3. On 2$B7n(B26$BF|(B, $B8a8e(B8:02, 7stud <> wrote:
    > On Feb 26, 3:43 am, "masayuki.takagi" <> wrote:
    >
    > > hi all,

    >
    > > i want to measure memory usage of my python process on Mac OSX.

    >
    > > i tired resource module, but it doesn't work on OSX.

    >
    > > how can i get it ?

    >
    > > thnx.

    >
    > > -- masayuki takagi

    >
    > #mac osx 10.4.7
    > import resource
    >
    > print resource.getrusage(resource.RUSAGE_SELF)
    >
    > --output:--
    > (0.009417, 0.020122999999999999, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0,
    > 0, 0)


    hum...

    for example below, which elment of the output means the memory usage?
    the list i should use about 16MB.

    #mac osx 10.4.11
    import resource
    i = range( 0, 1000000)
    print resource.getrusage(resource.RUSAGE_SELF)

    --output:--
    (0.042582999999999996, 0.064561999999999994, 0, 0, 0, 0, 0, 0, 0, 0,
    16, 0, 0, 0, 103, 0)
    masayuki.takagi, Feb 26, 2008
    #3
    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. Sven
    Replies:
    2
    Views:
    9,158
    Peter Schmidt
    Nov 7, 2005
  2. metfan
    Replies:
    2
    Views:
    4,845
    Robert Olofsson
    Oct 21, 2003
  3. Rune Strand

    Measure memory usage in Python

    Rune Strand, Apr 30, 2006, in forum: Python
    Replies:
    3
    Views:
    2,324
    gene tani
    May 1, 2006
  4. hvt
    Replies:
    0
    Views:
    1,206
  5. hvt
    Replies:
    0
    Views:
    1,462
Loading...

Share This Page