Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > how to measure memory usage on Mac OSX ?

Reply
Thread Tools

how to measure memory usage on Mac OSX ?

 
 
masayuki.takagi
Guest
Posts: n/a
 
      02-26-2008
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


 
Reply With Quote
 
 
 
 
7stud
Guest
Posts: n/a
 
      02-26-2008
On Feb 26, 3:43*am, "masayuki.takagi" <(E-Mail Removed)> 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)
 
Reply With Quote
 
 
 
 
masayuki.takagi
Guest
Posts: n/a
 
      02-26-2008
On 2月26日, 午後8:02, 7stud <(E-Mail Removed)> wrote:
> On Feb 26, 3:43 am, "masayuki.takagi" <(E-Mail Removed)> 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)


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
Measure memory usage in Python Rune Strand Python 3 05-01-2006 02:08 PM
Measure Bandwidth Usage Per Web Site Sven ASP .Net 2 11-07-2005 02:48 PM
How to measure ink(toner) usage! AVPSoft Digital Photography 8 11-09-2004 10:09 PM



Advertisments