caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Shivkumar Chandrasekaran <shiv@ece.ucsb.edu>
To: caml-list@inria.fr
Subject: Re: [Caml-list] Slow GC problem
Date: Thu, 10 Apr 2003 14:21:47 -0700	[thread overview]
Message-ID: <6FA5A4AF-6B9A-11D7-B23F-000393942C76@ece.ucsb.edu> (raw)
In-Reply-To: <2E57564C-69AC-11D7-B7DE-0003930FCE12@inria.fr>


I took Damien's advice (thanks) and spent some time trying to re-use 
all the bigarrays I was allocating. However, my bigarray use is spread 
out over a fairly complicated algorithm, and the only way to make a 
good dent on  bigarray use would be to completely rewrite the algorithm 
in a more traditional fortran77 style. Which would of course mean that 
I would have to first figure out the entire memory usage pattern.

...... So I am pondering another solution:

What if I modified bigarray_stubs.c to use the malloc and free calls of 
the Boehm gc (6.1-4) garbage collector? My reasoning is that malloc is 
performing poorly due to fragmentation, and switching to a gc'd version 
might help out.

Before I try this I would like some feedback from the list on the 
soundness of this idea. Thanks,

--shiv--

On Tuesday, April 8, 2003, at 03:23 AM, Damien Doligez wrote:

>> I have a gc efficiency problem for which I require some advice. I 
>> have read both the O'Reilly book and the manual on gc.
> [...]
>>  Below I give the gc stats just before and after the solver routine 
>> is called in the in-core solver:
>>
>> 				"Just before"	"Just after"
>> minor_words:		46243376	139259767
>> promoted_words:	928267		2595523
>> major_words:		2883087		39489766
>> minor_collections:	1412		4591
>> major_collections:	18			52
>> heap_words:		2150400		1044480
>> heap_chunks:		35			17
>> top_heap_words:	2150400		5038080
>> live_words:		1842373		840037
>> live_blocks:		253926		116816
>> free_words:		307180		204440
>> free_blocks:		47368		17
>> largest_free:		10928		61440
>> fragments:		847			3
>> compactions:		0			2
>
> As others have said, this is not really enough information to tell
> what is going on.  What we can say from the above is:
>
> 1. You are allocating lots and lots of data structures in the major
>    heap (maybe finalized bigarray descriptors)
> 2. The compactor was called twice, which may indicate that you have
>    a fragmentation problem.
> 3. The compactor was called near the end of the solver routine,
>    which must have erased most of the evidence...
>
> -- Damien
>
--shiv--

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


  reply	other threads:[~2003-04-10 21:22 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-04 19:40 Shivkumar Chandrasekaran
2003-04-03 21:07 ` Christophe Raffalli
2003-04-07 17:53 ` Shivkumar Chandrasekaran
2003-04-07 19:08   ` Chris Hecker
2003-04-08  7:15     ` David Monniaux
2003-04-08 10:28   ` Damien Doligez
2003-04-08 23:03     ` Shivkumar Chandrasekaran
2003-04-08 10:23 ` Damien Doligez
2003-04-10 21:21   ` Shivkumar Chandrasekaran [this message]
2003-04-10 21:51     ` Brian Hurt
2003-04-11  7:10     ` Chris Hecker
2003-04-11  7:58       ` Christophe Raffalli
2003-04-11 16:35         ` Shivkumar Chandrasekaran
2003-04-14 16:37 Shivkumar Chandrasekaran
2003-10-23  8:17 Chris Hecker

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=6FA5A4AF-6B9A-11D7-B23F-000393942C76@ece.ucsb.edu \
    --to=shiv@ece.ucsb.edu \
    --cc=caml-list@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).