guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bringing back gc-live-object-stats


From: Mark H Weaver
Subject: Re: Bringing back gc-live-object-stats
Date: Wed, 15 May 2019 21:39:46 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.2 (gnu/linux)

Amirouche Boubekki <address@hidden> writes:

> I am stuck with a memory leak. I think gc-live-object-stats [0] would help.
>
> [0] 
> https://www.gnu.org/software/guile/manual/html_node/Garbage-Collection-Functions.html#index-gc_002dlive_002dobject_002dstats
>
> Can some explain to me how to bring it back?

I don't believe that libgc provides the necessary APIs to efficiently
provide that old interface.  You'd need to begin by learning libgc
internals, and figure out what needs to be done.  Then you'd need to
convince the libgc developers to incorporate your changes.  Two broad
approaches that come to mind would be: (1) for libgc to keep a running
count of the number of live objects of each type, incrementing the
counts during allocations and decrementing them in the sweep phase, or
(2) provide an interface to iterate over all live objects.  In the
latter case there'd be thread safety issues.  Guile would also need
modifications to tell libgc the types of the objects.

Personally, I suggest finding another approach to debug your leak.

I don't want to spend much time on this, because I suspect it would be a
lot of work for questionable benefit, and it's not clear whether the
result of that work will be acceptable to either libgc or Guile.  It
might introduce too much added complexity or overhead.

     Regards,
       Mark



reply via email to

[Prev in Thread] Current Thread [Next in Thread]