Spent some days hunting memory leaks, completely resolved and now working.<div><div><br></div><div>Here's the roundup:<div><br></div><div> * Found two ways to track this kind of problems:</div><div><br></div><div>    * Print out current-thread's backtrace at garbage collect. If lots of objects or stack frames are being allocated unintendedly, you'll learn lots about that from the backtrace at gc time, for the thread that was running when the gc trigged.</div>




<div><br></div><div>    * Locate objects that don't collect and find their roots with ##resolve-referencing-objects . Get hold of their references in the first place using object->serial-number and ##serial-number-to-object-table .</div>


<div><br></div><div>  documented at <a href="http://dynamo.iro.umontreal.ca/wiki/index.php/Debugging#Suggestions_for_tracking_down_hard_to_find_problems" target="_blank">http://dynamo.iro.umontreal.ca/wiki/index.php/Debugging#Suggestions_for_tracking_down_hard_to_find_problems</a></div>




<div><br></div><div><br></div><div> * Don't do this:<br><br></div><div>   * (will-execute! (make-will your-object (lambda (v) (void)))) , that will will never GC. I guess it's a bug.</div><div>     <a href="https://github.com/feeley/gambit/issues/33" target="_blank">https://github.com/feeley/gambit/issues/33</a></div>




<div><font face="arial, helvetica, sans-serif"><br></font></div><div><font face="arial, helvetica, sans-serif">   * <span style="background-color:rgb(248,248,248);color:rgb(51,51,51);font-size:13px;line-height:19px">(output-port-timeout-set! port timeout (lambda () (close-port port) #f))</span>, </font>if the port had data left to drain <font face="arial, helvetica, sans-serif">th</font>at creates an infinite recursion up to heap overflow.</div>




<div>     <a href="https://github.com/feeley/gambit/issues/35" target="_blank">https://github.com/feeley/gambit/issues/35</a></div><div><br></div><div>   * ##thread-continuation-capture, in the currently latest commit ffd839c64f66278cdb4cce5ef86316ee290a4204 it leaks. Fix below.</div>


<div>     <a href="https://github.com/feeley/gambit/issues/36" target="_blank">https://github.com/feeley/gambit/issues/36</a></div><div><br></div><div>
Brgds,</div><div>
Mikael</div><div><br></div></div>
</div>