[gambit-list] Space leak or bad gc parameters?
feeley at iro.umontreal.ca
Sun May 17 10:42:22 EDT 2015
> On May 17, 2015, at 1:13 AM, Denis Fourt <denis.prog at hotmail.com> wrote:
> I have just pasted it in gsi -:s so it should be ok, please have a look. I have also tried chibi and chicken and only scheme48 was able to achieve it with less than 60MB (although it was rather slow). Please tell me if you would like to see the more crude version with delay as a thunk.
If you compile the program it runs fine and with as little as 20MB heap.
The reason you are seeing a slowdown with the interpreter is that closures are not “safe for space” with the interpreter (but are “safe for space” with the compiler). Safe for space means that a closure (in this case the one hidden in the implementation of “delay” in cons-stream) will only remember its free variables. The interpreter keeps all “in scope” variables in the closure. This is a deliberate decision because it gives a better debugging experience (you can inspect the free variables of a closure x with ,(v x) followed by ,e) allowing a better understanding of the evaluation context.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 4839 bytes
Desc: not available
More information about the Gambit-list