[gambit-list] Dumping the heap

Guillaume Cartier gcartier at jazzscheme.org
Thu Feb 1 07:46:19 EST 2018


Marc you wrote 2 pieces of code:

- a heap walker: ##walk-object!
- a function to copy recursively an object to a new memory zone (STILL,
PERMANENT, ...): ##copy-object

you also wrote a small test function: test-walk at the end of the file to
showcase those

The goal for me was to move large pieces of stable memory (classes for
example) to PERMANENT memory so as to diminish the pressure on the garbage
collector in the video game I'm writing. I ended up not using it in the
game as I was never able to make it work correctly due to the complexities
of the structures I wanted to copy.

The implementation is available here:
https://github.com/jazzscheme/jazz/blob/master/lib/gambit.walk/src/gambit/walk/implementation.scm.
Dimitri, just remove the surrounding (unit protected
gambit.walk.implementation ...) expression to get pure Gambit code.

Note that Gambit 4.8.8 broke some pieces of the code. See the ;; fix gambit
4.8.8 undefined warnings comments throughout the code (should not be too
hard to fix I think).

Guillaume

On Wed, Jan 31, 2018 at 9:23 AM, Dimitris Vyzovitis <vyzo at hackzen.org>
wrote:

> awesome, thank you!
>
> -- vyzo
>
> On Wed, Jan 31, 2018 at 4:03 PM, Guillaume Cartier <
> gcartier at jazzscheme.org> wrote:
>
>> Yes Marc wrote some very nice code to explore the Gambit heap
>> programmaticaly that I use in my projects. I'll refresh myself on the code
>> and post it in a Gambit friendly format shortly.
>>
>> Guillaume
>>
>> On Wed, Jan 31, 2018 at 8:08 AM, Marc Feeley <feeley at iro.umontreal.ca>
>> wrote:
>>
>>> Yes I remember helping Guillaume Cartier develop a procedure to do
>>> this.  Perhaps he can help you with that.
>>>
>>> Marc
>>>
>>>
>>>
>>> > On Jan 29, 2018, at 1:00 PM, Dimitris Vyzovitis <vyzo at hackzen.org>
>>> wrote:
>>> >
>>> > Is there a reasonable way to dump the live heap?
>>> > It could help a lot with debugging memory leaks.
>>> >
>>> > -- vyzo
>>>
>>> _______________________________________________
>>> 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/20180201/e8c46fe4/attachment.html 


More information about the Gambit-list mailing list