From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id RAA15316 for caml-red; Wed, 28 Jun 2000 17:46:42 +0200 (MET DST) Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id OAA12756 for ; Wed, 28 Jun 2000 14:50:01 +0200 (MET DST) Received: from air.irisa.fr (air.irisa.fr [131.254.60.130]) by concorde.inria.fr (8.10.0/8.10.0) with ESMTP id e5SCnkX17881 for ; Wed, 28 Jun 2000 14:49:46 +0200 (MET DST) Received: from parate.irisa.fr (parate.irisa.fr [131.254.12.25]) by air.irisa.fr (8.9.3/8.9.3) with ESMTP id OAA03159; Wed, 28 Jun 2000 14:49:46 +0200 (MET DST) To: Cc: "Liste-Caml" Subject: Re: Memory usage References: From: David.Mentre@irisa.fr (David=?iso-8859-1?q?_Mentr=E9?=) Date: 28 Jun 2000 14:49:45 +0200 In-Reply-To: "Dorlet Emmanuel"'s message of "Mon, 26 Jun 2000 15:28:59 +0200" Message-ID: User-Agent: Gnus/5.0805 (Gnus v5.8.5) Emacs/20.6 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: weis@pauillac.inria.fr "Dorlet Emmanuel" writes: > Does any one has a good and simple suggestion? To monitor global memory usage, I use the following code : # let stat = Gc.stat () and control = Gc.get () in let max_words_total = stat.Gc.heap_words + control.Gc.minor_heap_size in Printf.printf "Maximum memory used (allocated): %d kBytes\n" (max_words_total * Sys.word_size / 8 / 1024);; Maximum memory used (allocated): 624 kBytes - : unit = () It gives you the total heap allocated. Moreover, at the following URL, you'll find a program, "size", to compute memory size of an OCaml value : http://www.lri.fr/~filliatr/software.en.html If you have more precise ways to know memory behavior, I would be very interested in them. Best regards, d. -- David.Mentre@irisa.fr -- http://www.irisa.fr/prive/dmentre/ Opinions expressed here are only mine.