From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: weis Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id PAA09237 for caml-redistribution; Tue, 23 Nov 1999 15:15:35 +0100 (MET) 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 UAA08813 for ; Mon, 22 Nov 1999 20:24:35 +0100 (MET) Received: from tobago.inria.fr (tobago.inria.fr [128.93.8.21]) by concorde.inria.fr (8.8.7/8.8.7) with ESMTP id UAA22818 for ; Mon, 22 Nov 1999 20:24:34 +0100 (MET) Received: (from doligez@localhost) by tobago.inria.fr (8.6.10/8.6.6) id UAA25229 for caml-list@inria.fr; Mon, 22 Nov 1999 20:24:33 +0100 Date: Mon, 22 Nov 1999 20:24:33 +0100 From: Damien Doligez Message-Id: <199911221924.UAA25229@tobago.inria.fr> To: caml-list@inria.fr Subject: Re: [GC] Evaluate memory use Sender: weis >From: David.Mentre@irisa.fr (David =?iso-8859-1?q?Mentré?=) [ short french: > Comment connaître la consommation mémoire maximum d'un programme OCaml Vous pouvez répéter la question ? ] >Is there any way to know the maximum memory used by an OCaml program? What do you mean exactly by "maximum memory used" ? Is it the maximum amount of memory allocated from the OS or the maximum amount used to store useful data ? In the first case, it's the current amount, unless you activate the compacter; in the second case, there's no way to get the right answer. >Right now, I'm using Gc.heap_words, but it doesn't seem to be very That's the current size of the major heap, including overhead and free memory. You could add "control.Gc.minor_heap_size" (from the result of "Gc.get ()") to get the total size of the heaps. > let max_words_total = stats.Gc.minor_words - stats.Gc.promoted_words > + stats.Gc.heap_words in That just doesn't make sense. It's the number of garbage words collected by the minor GC (since the program started), added to the current size of the major heap. >BTW, is there any simple way to evaluate Wall Clock Time used by an >OCaml program? Right now, I'm using 'Unix.gettimeofday ()'. Is there a >simpler way to do it? No, there's nothing simpler. Is it not simple enough ? -- Damien