unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Mark H Weaver <mhw@netris.org>
To: Amirouche Boubekki <amirouche.boubekki@gmail.com>
Cc: guile-devel <guile-devel@gnu.org>
Subject: Re: Bringing back gc-live-object-stats
Date: Wed, 15 May 2019 21:39:46 -0400	[thread overview]
Message-ID: <87pnoji3cy.fsf@netris.org> (raw)
In-Reply-To: <CAL7_Mo_q3=mVfJ5zZEO25cDH4fMVCq3T4e4Z+TkOSu+5u9EHxA@mail.gmail.com> (Amirouche Boubekki's message of "Tue, 14 May 2019 19:34:01 +0200")

Amirouche Boubekki <amirouche.boubekki@gmail.com> 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	other threads:[~2019-05-16  1:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-14 17:34 Bringing back gc-live-object-stats Amirouche Boubekki
2019-05-16  1:39 ` Mark H Weaver [this message]
2019-05-16 12:10   ` Amirouche Boubekki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87pnoji3cy.fsf@netris.org \
    --to=mhw@netris.org \
    --cc=amirouche.boubekki@gmail.com \
    --cc=guile-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).