[SciPy-user] Arrays and strange memory usage ...

Uwe Schmitt rocksportrocker@googlemail....
Wed Sep 3 06:57:09 CDT 2008



On 2 Sep., 19:11, christophe grimault
<christophe.grima...@novagrid.com> wrote:
> Hi,
>
> I have a application that is very demanding in memory ressources. So I
> started to to look closer at python + numpy/scipy as far as memory is
> concerned.
>
> I can't explain the following :
>
> I start my python, + import scipy. A 'top' in the console shows that :
>
>   PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME COMMAND
> 14791 grimault  20   0 21624 8044 3200 S    0  0.4   0:00.43 python
>
> Now after typing :
>
> z = scipy.arange(1000000)
>
> I get :
> 14791 grimault  20   0 25532  11m 3204 S    0  0.6   0:00.44 python
>
> So the memory increased by ~ 7 Mb. I was expecting 4 Mb since the data
> type is int32, giving 4*1000000 = 4 Mb of memory chunk (in C/C++ at
> least).

I do not see the 7MB. Virtual memory increased by 3,9 MB and RES
(which is the number you are looking for), differs by 3+X MB,
I do not know how RES is rounded. But this is not a contraction.

Greetings, Uwe


More information about the SciPy-user mailing list