Maxima eating up memory?



"Philipp E. Imhof" <fippu at fippu.ch> writes:
> I do not think that this is related to my program, as it can easily be
> reproduced by
>
> for i from 1 thru 10**10 do
>     display(ifactors(i*(1+random(10**5))));
>
> This eats up quite some memory. After some 150MB and Ctrl-C, the
> memory is not freed, as described above. After issuing quit(), the
> 150MB immediately move from 'used' to 'free' in top.

Can you give us slightly more information about which version of Maxima
and what lisp you're using? (Also, I presume this isn't wxMaxima?)

On my machine, I can't reproduce this. I have

   Maxima 5.25post http://maxima.sourceforge.net
   using Lisp SBCL 1.0.52.0.debian

and before running it, here is what SBCL thinks its memory usage is:

   (%i1) :lisp (room)

   Dynamic space usage is:   63,111,880 bytes.
   Read-only space usage is:      3,512 bytes.
   Static space usage is:         2,256 bytes.
   Control stack usage is:        2,232 bytes.
   Binding stack usage is:          296 bytes.
   Control and binding stack usage is for the current thread only.
   Garbage collection is currently enabled.

   Breakdown for dynamic space:
     20,423,552 bytes for    20,383 code objects.
     14,818,296 bytes for 1,852,287 cons objects.
      6,132,216 bytes for   116,770 simple-vector objects.
      6,106,752 bytes for    68,193 simple-character-string objects.
      6,063,936 bytes for   144,657 instance objects.
      9,575,296 bytes for   261,917 other objects.
     63,120,048 bytes for 2,464,207 dynamic objects (space total.)

and htop says:

18278 rupert    20   0  525M 63624 51308 S  0.0  2.0  0:00.23 sbcl --core /h...

(the 2.0 is MEM% and 63624 means 63mb resident memory, I think).

Now let it run for 1 minute of CPU time (copy and pasting your code into
a terminal)

18278 rupert    20   0  525M 66584 51476 S  0.0  2.1  1:00.45 sbcl --core /h...

and SBCL says:

(%i2) :lisp (room)

Dynamic space usage is:   67,889,152 bytes.
Read-only space usage is:      3,512 bytes.
Static space usage is:         2,256 bytes.
Control stack usage is:        2,232 bytes.
Binding stack usage is:          296 bytes.
Control and binding stack usage is for the current thread only.
Garbage collection is currently enabled.

Breakdown for dynamic space:
  20,423,552 bytes for    20,383 code objects.
  16,148,280 bytes for 2,018,535 cons objects.
   6,892,264 bytes for   178,769 instance objects.
   6,049,784 bytes for   114,112 simple-vector objects.
   5,396,480 bytes for    47,818 simple-character-string objects.
   5,196,024 bytes for   572,917 bignum objects.
   9,810,320 bytes for   397,568 other objects.
  69,916,704 bytes for 3,350,102 dynamic objects (space total.)


This doesn't seem to be the behaviour you're seeing, so maybe you can
tell us a bit more about your setup?


Rupert
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 315 bytes
Desc: not available
URL: <http://www.math.utexas.edu/pipermail/maxima/attachments/20111027/bca9e682/attachment.pgp>;