[gambit-list] Roundup after memory leak hunt.

Mikael mikael.rcv at gmail.com
Sun Jun 23 17:11:16 EDT 2013


Spent some days hunting memory leaks, completely resolved and now working.

Here's the roundup:

 * Found two ways to track this kind of problems:

    * 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.

    * 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
.

  documented at
http://dynamo.iro.umontreal.ca/wiki/index.php/Debugging#Suggestions_for_tracking_down_hard_to_find_problems


 * Don't do this:

   * (will-execute! (make-will your-object (lambda (v) (void)))) , that
will will never GC. I guess it's a bug.
     https://github.com/feeley/gambit/issues/33

   * (output-port-timeout-set! port timeout (lambda () (close-port port)
#f)), if the port had data left to drain that creates an infinite recursion
up to heap overflow.
     https://github.com/feeley/gambit/issues/35

   * ##thread-continuation-capture, in the currently latest commit
ffd839c64f66278cdb4cce5ef86316ee290a4204 it leaks. Fix below.
     https://github.com/feeley/gambit/issues/36

Brgds,
Mikael
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.iro.umontreal.ca/pipermail/gambit-list/attachments/20130624/b913f6af/attachment.htm>


More information about the Gambit-list mailing list