unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Mark H Weaver <mhw@netris.org>
To: Andy Wingo <wingo@pobox.com>
Cc: bdwgc@lists.opendylan.org, guile-devel@gnu.org
Subject: Re: Memory accounting in libgc
Date: Wed, 12 Mar 2014 02:57:48 -0400	[thread overview]
Message-ID: <874n339a4z.fsf@yeeloong.lan> (raw)
In-Reply-To: <87k3c33awa.fsf@pobox.com> (Andy Wingo's message of "Sun, 09 Mar 2014 11:48:53 +0100")

Andy Wingo <wingo@pobox.com> writes:

> How does this affect libgc?
>
> First of all, it gives an answer to the question of "how much memory
> does an object use" -- simply stop the world, mark the heap in two parts
> (the first time ignoring the object in question, the second time
> starting from the object), and subtract the live heap size of the former
> from the latter.  Libgc could do this without too much problem, it seems
> to me, on objects of any kind.  It would be a little extra code but it
> could be useful.  Or not?  Dunno.

This could be generalized to the far more useful question: "How much
memory does this set of objects use?", although that's a slippery
question that might better be formulated as "How much memory would be
freed if this set of objects were no longer needed?".

For example, suppose you have a large data structure that is referenced
from two small header objects, A and B.  If you ask "How much memory
does A use?", the answer will be the size of the small header, and ditto
for B.  Without being able to ask the more general question, there's no
way to find out how much would be freed by releasing both.

     Mark



       reply	other threads:[~2014-03-12  6:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <87k3c33awa.fsf@pobox.com>
2014-03-12  6:57 ` Mark H Weaver [this message]
2014-03-12  8:27   ` Memory accounting in libgc Andrew Gaylard
2014-03-13 14:46   ` Neil Jerram
     [not found] ` <87k3c33awa.fsf-e+AXbWqSrlAAvxtiuMwx3w@public.gmane.org>
2014-03-18 15:10   ` [Gc] " Noah Lavine
2014-03-09 10:48 Andy Wingo

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=874n339a4z.fsf@yeeloong.lan \
    --to=mhw@netris.org \
    --cc=bdwgc@lists.opendylan.org \
    --cc=guile-devel@gnu.org \
    --cc=wingo@pobox.com \
    /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).