Maxima eating up memory?



Hello!

I created a program that calculates the square root of an integer 
modulo another integer. In order to check for mistakes, I decided to 
run some automatic testing, by doing a brute-force search for all 
roots and comparing them to the roots found by my program.

During these tests, I ran into memory problems. With each iteration 
of the test, Maxima uses more and more memory until it finally 
stops, saying it cannot allocate memory.

What is very strange to me, is that memory does never seem to get 
freed. If, for example, I run a shorter test loop which can be 
sucessfully completed, I would expect the amount of free memory to 
raise, as Maxima is 'sleeping'. But 'top' shows that this is not the 
case.  Even after issuing reset() and kill(all), the memory stays 
low until I quit() Maxima.

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.

Is there anything I can do in order to free unused memory within 
Maxima without quit()ting ? Is this a bug?


Thank you very much for your help. Best regards


Philipp