On Tue, Oct 27, 2009 at 04:01:31PM -0400, Divya Muthukumaran wrote:
> I just got started on ocaml and am new to functional programming. I have
> written a ocaml module for CIL to analyze a C program. The problem I am
> having is that at some point in the analysis, the program just hangs.
> When I run with the -v option, at the point at which the program seems
> stuck, I get a series of messages saying "Starting new major GC cycle". I
> know this is related to garbage collection. I tried inserting a few
> Gc.print_stat statements in my code, but nothing gets printed to stdout.
> Could someone tell me what the problem might be.
It's hard to say from your description, but could it be that the total
memory used is bigger than the available memory, and it's thrashing?
The OCaml GC cannot handle this situation well.
On a Linux machine you can find out by running 'vmstat 1' and looking
at the swap/si and swap/so columns. If those columns are large
numbers, then the machine is thrashing.
Rich.
--
Richard Jones
Red Hat