Version française
Home     About     Download     Resources     Contact us    
Browse thread
Garbage collection in OCaml
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Francois Rouaix <frouaix@m...>
Subject: Re: Garbage collection in OCaml
> 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).

> 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.

That would be typical of an application that is stable in memory
allocation (no leaks), but has a pattern of allocation that causes
fragmentation. I have that a lot in network applications that use
buffers for I/O, and I usually either call Gc.compact once in a while,
or I set max_overhead in Gc.control to something like 50.
For example, one of the servers behind shopping.nbci.com uses anywhere
from 300M to 500M, but I have to leave the compaction to avoid
swapping.

--f