<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>Thanks for the explanation, using gsc leads effectively to a normal behaviour. <div><br></div><div>Denis<br><br><div>> Subject: Re: [gambit-list] Space leak or bad gc parameters?<br>> From: feeley@iro.umontreal.ca<br>> Date: Sun, 17 May 2015 10:42:22 -0400<br>> CC: gambit-list@iro.umontreal.ca<br>> To: denis.prog@hotmail.com<br>> <br>> <br>> > On May 17, 2015, at 1:13 AM, Denis Fourt <denis.prog@hotmail.com> wrote:<br>> > <br>> > 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.<br>> > <br>> > Denis<br>> <br>> If you compile the program it runs fine and with as little as 20MB heap.<br>> <br>> 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.<br>> <br>> Marc<br>> <br></div></div>                                         </div></body>
</html>