[Ecls-list] how to enable bigger stacks?
Juan Jose Garcia-Ripoll
juanjose.garciaripoll at googlemail.com
Wed May 20 08:21:42 UTC 2009
Dear Mr. Kullmann,
please learn to have a little patience. While The Internet may have
gotten us used to have immediate answer and reward to our questions
and wishes, some times this takes time.
I have read your somewhat angry message today, right after I had
finished preparing some documentation after your previous email
Due to different fights with the local telephone companies I do not
have internet access at home, and working 16 hours a day sometimes
leaves little time to do email exchange. But I do take people's
requests and questions seriously, even if the human nature is somewhat
On Tue, May 19, 2009 at 6:49 PM, Oliver Kullmann
<O.Kullmann at swansea.ac.uk> wrote:
> Additionally I get
> GC Warning: Out of Memory! Returning NIL!
> Maxima encountered a Lisp error:
> Memory limit reached. Please jump to an outer point or quit program.
> Automatically continuing.
> on a 64-bit machine for a problem which could be handled before.
No, the thing is that it was _NOT_ handled at all. Previous versions
of ECL did not care about memory limits, stack limits and so on. They
simply grew and grew. And that is not correct. The new system allows
for better error recovery, even if people do not make use of it.
You, like many other people, seem to be mistified by Linux's
potentially unlimited memory and humongous stack limits. What happens
when you reach those limits? Well, you pretty much have exhausted your
resources and there is no way back. Either you quit or you unroll your
whole computation and start again.
Right now ECL sets up some limits which you can enlarge (Read the new
chapter in the manual please), and if your application does need a lot
of memory then you should set those limits to a large value by
default. Thanks to the existence of those limits, if you hit a too
deeply recursive function, you can still recover by increasing the
stack limits. The recovery can be even done programatically as in
(labels ((foo (x)
(catch 'foo (foo (1+ x))))
(let ((s (ext:stack-overflow-size c)))
(if (< s 2304)
(return-from faa (ext::stack-overflow-type c))))))
(handler-bind ((ext:stack-overflow #'handle-overflow))
Incidentally, we had to set up these limits because Maxima users coded
infinitely recursive functions and crashed the lisp image.
> So I can't run any serious application anymore (on 32-bit and 64-bit
It depends on what you deem serious.
> Perhaps if Ecl is not aiming at applications requiring more than,
> say, 100MB, then this should be stated clearly somewhere, since
> otherwise it is a trap for the user (who should use a different
> Lisp, without these restrictions, if he has such usage requirements).
ECL is not restricted to applications with low memory requirements.
You may set the memory limit to 16 gigabytes if you wish. Or you may
change it dynamically while your program is running.
Instituto de Física Fundamental, CSIC
c/ Serrano, 113b, Madrid 28009 (Spain)
More information about the ecl-devel