From: Andy Wingo <wingo@pobox.com>
To: ludo@gnu.org (Ludovic Courtès)
Cc: guile-devel@gnu.org, Neil Jerram <neil@ossau.uklinux.net>
Subject: Re: [PATCH] Configure GMP to use GC allocation functions, remove bignum finalizers
Date: Mon, 28 Nov 2011 23:23:08 +0100 [thread overview]
Message-ID: <87r50ranub.fsf@pobox.com> (raw)
In-Reply-To: <8762i5mf4x.fsf@gnu.org> ("Ludovic Courtès"'s message of "Sun, 27 Nov 2011 22:25:50 +0100")
On Sun 27 Nov 2011 22:25, ludo@gnu.org (Ludovic Courtès) writes:
> The problem is that this measurement doesn’t allow us to differentiate
> between a growing heap with objects that may be freed as a result of
> running the GC, and a growing heap just because the application needs
> more malloc’d objects.
This is true, but typically the heap stabilizes at some point.
Here is the problem: if you are allocating at a GC-managed heap size H,
garbage collection will tend to limit your process image size to H*N.
But if at the same time you are mallocating at a rate M bytes per
GC-allocated byte, then your process stabilizes at H*N*M -- assuming
that collecting data will result in malloc'd data being freed. It
doesn't take a very large M for this to be a bad situation. If you
would like to limit your image size, you should GC more often -- the
bigger the M, the more often.
The original iterative factorial case that Mark gave is pessimal,
because M is an increasing function of time.
Now, what happens if the process is not growing because of GC, but for
other reasons? In that case M will be estimated as artificially high
for a while, and so GC will happen more often on the Guile side. But
when it stabilizes, we can ease back the GC frequency.
The key is to measure process image growth, not mallocation rate.
I'm going to give this a try and see what happens.
Andy
--
http://wingolog.org/
next prev parent reply other threads:[~2011-11-28 22:23 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-31 19:48 [PATCH] Configure GMP to use GC allocation functions, remove bignum finalizers Mark H Weaver
2011-05-31 20:07 ` Mark H Weaver
2011-05-31 21:52 ` Ludovic Courtès
2011-05-31 23:18 ` Neil Jerram
2011-05-31 23:32 ` Neil Jerram
2011-06-01 8:34 ` Andy Wingo
2011-06-02 23:14 ` Ludovic Courtès
2011-11-27 19:33 ` Andy Wingo
2011-11-27 21:25 ` Ludovic Courtès
2011-11-28 22:23 ` Andy Wingo [this message]
2011-11-28 23:10 ` Ludovic Courtès
2011-11-28 23:50 ` Andy Wingo
2011-11-29 11:06 ` Ludovic Courtès
2011-11-29 11:35 ` Andy Wingo
2011-11-29 13:20 ` Ludovic Courtès
2011-11-29 12:45 ` Andy Wingo
2011-11-29 13:18 ` Ludovic Courtès
2011-11-29 14:44 ` Andy Wingo
2011-11-29 16:22 ` Ludovic Courtès
2011-12-02 11:10 ` Andy Wingo
2011-12-02 17:02 ` Ludovic Courtès
2011-12-02 18:12 ` Andy Wingo
2011-12-02 22:17 ` Ludovic Courtès
2011-12-03 10:57 ` Andy Wingo
2011-12-03 17:57 ` Ludovic Courtès
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=87r50ranub.fsf@pobox.com \
--to=wingo@pobox.com \
--cc=guile-devel@gnu.org \
--cc=ludo@gnu.org \
--cc=neil@ossau.uklinux.net \
/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).