[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.python

how to measure memory usage on Mac OSX ?

masayuki.takagi

2/26/2008 10:43:00 AM

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


2 Answers

7stud --

2/26/2008 11:03:00 AM

0

On Feb 26, 3:43 am, "masayuki.takagi" <kamona...@gmail.com> 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)

masayuki.takagi

2/26/2008 11:20:00 AM

0

On 2?26?, ??8:02, 7stud <bbxx789_0...@yahoo.com> wrote:
> On Feb 26, 3:43 am, "masayuki.takagi" <kamona...@gmail.com> 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)