2 Oct 2000 11:23
Re: Garbage collection in OCaml
Damien Doligez <Damien.Doligez <at> inria.fr>
2000-10-02 09:23:36 GMT
2000-10-02 09:23:36 GMT
>From: "David McClain" <dmcclain <at> azstarnet.com> >I have a long running analysis program written in compiled OCaml (ocamlopt). >If I let it run without interference it gradually allocates more and more >memory until the system swap space is exhausted. At that point the program >bombs off with an "out of memory" errror - probably generated by the OCaml >array management routines. Most likely, a fragmentation problem. If you're using a lot of arrays or strings with different sizes, it can happen. >OTOH, I found by tinkering that placing a Gc.compact() in a periodically >performed place, I manage to keep the entire system running within about 70 >MBytes. (My machines all have 256 MB RAM or more). Thus we know for sure it was a fragmentation problem. >I have found that placing a Gc.full_major() does virtually nothing to >prevent the exhaustion of memory, although it slows it down ever so >slightly. Gc.full_major() is not going to help, that's normal. >The program was compiled to run with the default GC settings (whatever those >are). That is to say, I did nothing to configure the GC system at program >startup. > >Is this behavior normal? Must I plant strategic Gc.compact() in my code? I >would have thought the GC would be more self monitoring.(Continue reading)
RSS Feed