caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: John Carr <jfc@MIT.EDU>
To: OCaml mailing list <caml-list@yquem.inria.fr>
Subject: Re: [Caml-list] Optimizing garbage collection
Date: Mon, 22 Nov 2010 13:38:07 -0500	[thread overview]
Message-ID: <201011221838.oAMIc7Yt021756@department-of-alchemy.mit.edu> (raw)
In-Reply-To: <B5DE1B36-F301-42DC-AC95-2513E35BA22F@inria.fr>


> When everything is smooth, the running time decreases something like
> exponentially with the minor heap size, so you'd always want to
> increase the size.  How do you tell when to stop?  And then, if the
> program is not behaving uniformly, when do you decide to reduce
> the size?

I don't understand "smooth".  Minor heap size should be based on the
rate of garbage generation relative to allocation to balance cache
misses with GC cost.  The ratio may be small or large independent of
whether it varies during the program.

The default minor heap size is well tuned for traditional functional
programming behavior: high rate of allocation, short lifetime.

When memory access is smaller than a cache line the cache does not
reward data reuse so much as address reuse.  Collecting a small minor
heap that is mostly garbage allows the allocator to start over at
an address that is already in cache.  Continuing to allocate instead
of collecting leads to write-allocate misses.


  parent reply	other threads:[~2010-11-22 18:38 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-18 15:51 Eray Ozkural
2010-11-19 14:54 ` [Caml-list] " Michael Ekstrand
2010-11-19 15:49   ` Eray Ozkural
2010-11-20  2:20   ` Eray Ozkural
2010-11-21 18:13     ` Alexandre Pilkiewicz
2010-11-21 19:26       ` Eray Ozkural
     [not found]       ` <577267187.967802.1290367612809.JavaMail.root@zmbs1.inria.fr>
2010-11-22 15:10         ` Damien Doligez
2010-11-22 16:27           ` Mauricio Fernandez
2010-11-22 16:42           ` Sylvain Le Gall
2010-11-22 18:07             ` [Caml-list] " Eray Ozkural
2010-11-22 21:14             ` Jon Harrop
2010-11-22 23:13               ` Eray Ozkural
2010-11-23 15:54                 ` Jon Harrop
2010-11-24 22:35                 ` Goswin von Brederlow
2010-11-22 18:38           ` John Carr [this message]
     [not found] <1832704169.1010021.1290451094930.JavaMail.root@zmbs1.inria.fr>
2010-11-23  9:48 ` [Caml-list] " Damien Doligez
2010-11-23 13:40   ` Christophe Raffalli
2010-11-23 16:43     ` Christophe Raffalli

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

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

  git send-email \
    --in-reply-to=201011221838.oAMIc7Yt021756@department-of-alchemy.mit.edu \
    --to=jfc@mit.edu \
    --cc=caml-list@yquem.inria.fr \
    /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 NNTP newsgroup(s).