caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Jean Krivine" <jean_krivine@hms.harvard.edu>
To: "Damien Doligez" <damien.doligez@inria.fr>, caml-list@yquem.inria.fr
Subject: Re: [Caml-list] Manually triggering garbage collection
Date: Tue, 29 Jul 2008 09:39:30 -0400	[thread overview]
Message-ID: <dc2907b70807290639g467813e6y87a9e6d911280191@mail.gmail.com> (raw)
In-Reply-To: <08F66ABF-5C25-4D49-8B0B-77B2F757C1DD@inria.fr>

OK great I' ll try,
For the moment I just set a Gc alarm that detects whether memory usage
is above a certain limit and if so, sets the overhead to 0, which
stops completely the memory "leak".
Do you think that would improve to increase the size of the major heap?
Also, do you know how often the alarm is tested? is it each time a
major collection is performed?

Thanks a lot
J

On Tue, Jul 29, 2008 at 8:53 AM, Damien Doligez <damien.doligez@inria.fr> wrote:
> Hello Jean,
>
> On 2008-07-26, at 21:15, Jean Krivine wrote:
>
>> I am running a memory intensive stochastic simulator written in ocaml.
>> After initialization of the data structure (which eats up a lot of
>> memory but that's normal) I observe a memory leak during the
>> simulation which should not be there.
>> I noticed that if I run Gc.major() every n computation events after
>> initialization (I can make n vary), then there is no more memory leak
>> (the memory the process is using is constant).
>>
>> So my question is the following:
>> Is there a rational way to detect I should call for Gc.Major()? (for
>> the moment I am triggering it every n events which is arbitrary)
>
>
> This might be a fragmentation problem, but if calling Gc.major()
> fixes it, I guess it's not a true leak (i.e. the memory would stabilize
> at some point).
>
> At any rate, you might want to try the CVS head version (3.11+dev):
> it uses first-fit allocation in order to fight fragmentation, and I'd
> like to know how well it does in the wild.
>
> -- Damien
>
>


  parent reply	other threads:[~2008-07-29 13:39 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-26 19:15 Jean Krivine
     [not found] ` <08F66ABF-5C25-4D49-8B0B-77B2F757C1DD@inria.fr>
2008-07-29 13:39   ` Jean Krivine [this message]
     [not found] <86F95E46-EF71-47F9-AE76-D765225CB597@inria.fr>
2008-07-29 13:57 ` [Caml-list] " Damien Doligez
2008-07-29 14:04   ` Jean Krivine

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=dc2907b70807290639g467813e6y87a9e6d911280191@mail.gmail.com \
    --to=jean_krivine@hms.harvard.edu \
    --cc=caml-list@yquem.inria.fr \
    --cc=damien.doligez@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).