[gambit-list] Space leak or bad gc parameters?

Denis Fourt denis.prog at hotmail.com
Tue May 19 14:47:44 EDT 2015


By the way, in that particular case it is also much faster (about 3 times) with gsc to create thunks to delay evaluation than using gambit delay macro. I suppose, gambit does some memoization of the result of the call of force. Is this the right thing to do?
Denis
From: denis.prog at hotmail.com
To: feeley at iro.umontreal.ca
Date: Sun, 17 May 2015 12:40:02 -0400
CC: gambit-list at iro.umontreal.ca
Subject: Re: [gambit-list] Space leak or bad gc parameters?




Thanks for the explanation, using gsc leads effectively to a normal behaviour. 
Denis

> Subject: Re: [gambit-list] Space leak or bad gc parameters?
> From: feeley at iro.umontreal.ca
> Date: Sun, 17 May 2015 10:42:22 -0400
> CC: gambit-list at iro.umontreal.ca
> To: denis.prog at hotmail.com
> 
> 
> > 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.
> > 
> > Denis
> 
> 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.
> 
> Marc
> 
 		 	   		  

_______________________________________________
Gambit-list mailing list
Gambit-list at iro.umontreal.ca
https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://webmail.iro.umontreal.ca/pipermail/gambit-list/attachments/20150519/9b04c476/attachment.html 


More information about the Gambit-list mailing list