Version française
Home     About     Download     Resources     Contact us    
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: -- (:)
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.


Alain