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
Memory management under OCAML
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 1999-08-31 (12:14)
From: David McClain <dmcclain@a...>
Subject: Memory management under OCAML
I am trying to understand the behavior of the interactive OCAML system. If I
repeatedly perform the following line:

    let x = Array.create 1000000 0.0;;

then each subsequent execution should shadow the previous ones making them
unreachable. Yet the GC never collects the old bindings, even after I
manually perform Gc.full_major() or Gc.compact().  Why is this?

In another vein, whenever I start OCAML in interactive mode on WinNT 4.0 it
grabs about 10 MBytes (give or take some). Yet when I compile my own code in
native code OCAMLOPT, my programs typically grab about 100 MBytes or so,
even before any overt memory allocations occur. Why is this? Should I even
be concerned about it? and is there a mechanism to preallocate a fixed
amount of heap for the runtime images I create?

D. McClain
Sr. Scientist
Raytheon Systems Co.
Tucson, AZ