caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Mike Lin <nilekim@gmail.com>
To: caml-list@yquem.inria.fr
Subject: GC troubleshooting
Date: Tue, 29 Mar 2005 13:17:00 -0500	[thread overview]
Message-ID: <2a1a1a0c05032910175cdbae94@mail.gmail.com> (raw)

Hi folks,

I'm not very experienced in troubleshooting fine GC issues, and
unfortunately I have a situation where the GC is really grinding me to
a halt. My program has a loop that needs to run about 20,000 times,
allocating a handful of lists, roughly between 10 and 100 in length,
in each iteration.

The first 8,000 or so iterations run fine, in a few minutes. Somewhere
around there, the GC starts to tear me a new one. I incompetently
played with different settings for the heap sizes, but I don't really
know what I'm doing. When I set the GC output to verbose, I see the
following type of output when it slows down:

$<>allocated_words = 77096
extra_heap_resources = 0u
amount of work to do = 1240u
ordered work = 0 words
computed work = 520396 words
Sweeping 520396 words
$<>allocated_words = 74450
extra_heap_resources = 0u
amount of work to do = 1198u
ordered work = 0 words
computed work = 502536 words
Sweeping 502536 words
$<>allocated_words = 71702
extra_heap_resources = 0u
amount of work to do = 1153u
ordered work = 0 words
computed work = 483988 words
Sweeping 483988 words
$<>allocated_words = 68841
extra_heap_resources = 0u
amount of work to do = 1107u
ordered work = 0 words
computed work = 464676 words
Sweeping 464676 words
...

These messages continue to occur so frequently that I think the GC is
doing much more work than the program itself.

The loop is doing some reasonable (I think) operations on these lists
- filter, fold_left, rev_append, rev_map, iter, and so forth. Each
iteration uses Printf to print a line to stdout. There are probably a
couple hundred megs of static data set (not being allocated or
deallocated) also present in memory, and being used by the loop.

Anyway, let me know if you have any ideas.

Mike


                 reply	other threads:[~2005-03-29 18:17 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=2a1a1a0c05032910175cdbae94@mail.gmail.com \
    --to=nilekim@gmail.com \
    --cc=caml-list@yquem.inria.fr \
    --cc=mikelin@mit.edu \
    /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).