caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Alain Frisch <alain.frisch@gmail.com>
To: Brighten Godfrey <pbg@cs.berkeley.edu>
Cc: Markus Mottl <markus.mottl@gmail.com>,
	OCaml List <caml-list@yquem.inria.fr>
Subject: Re: [Caml-list] Strange performance bug
Date: Wed, 29 Apr 2009 08:18:29 +0200	[thread overview]
Message-ID: <49F7F135.5080504@gmail.com> (raw)
In-Reply-To: <59BD1B3A-B449-4963-9910-ED5E755D00E6@cs.berkeley.edu>

Brighten Godfrey wrote:
> (Changing to the precompiled regexp does make this bug go away -- but so 
> do many other small changes, like commenting out the last line of the 
> code, *after* the parsing is complete.)

This last line (List.length first) + ...) forces the values first, 
second and third to remain alive. How big are these values in memory?

I would suggest to look closely at the memory usage and GC behavior of 
your program. I did not investigate your problem, so here is a random 
speculation: If the parsed file is big enough, PCRE will compile a lot 
of regexps; maybe the OCaml PCRE binding does not evaluate properly the 
memory usage of these regexps and so OCaml does not trigger a GC soon 
enough to release the compiled regexps; the process memory grows and the 
OS starts to swap your process.


Alain


  reply	other threads:[~2009-04-29  6:18 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-29  2:43 Brighten Godfrey
2009-04-29  3:37 ` [Caml-list] " Markus Mottl
2009-04-29  4:31   ` Brighten Godfrey
2009-04-29  6:18     ` Alain Frisch [this message]
2009-04-29  6:27       ` Brighten Godfrey
2009-04-29  6:37         ` Alain Frisch
2009-04-29  8:29           ` Brighten Godfrey
2009-04-29 13:58             ` Markus Mottl
2009-04-29 14:48               ` Damien Doligez
2009-04-29 16:03                 ` Markus Mottl
2009-04-29 19:19                   ` Brighten Godfrey
2009-04-29 19:38                     ` Markus Mottl
2009-04-29 20:23                       ` Brighten Godfrey

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=49F7F135.5080504@gmail.com \
    --to=alain.frisch@gmail.com \
    --cc=caml-list@yquem.inria.fr \
    --cc=markus.mottl@gmail.com \
    --cc=pbg@cs.berkeley.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).