English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
Strange performance bug
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2009-04-29 (06:18)
From: Alain Frisch <alain.frisch@g...>
Subject: Re: [Caml-list] Strange performance bug
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.