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 JAA19237 for caml-redistribution; Wed, 24 Nov 1999 09:15:30 +0100 (MET) Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id QAA03612 for ; Tue, 23 Nov 1999 16:53:42 +0100 (MET) Received: from parasite.irisa.fr (parasite.irisa.fr [131.254.12.47]) by nez-perce.inria.fr (8.8.7/8.8.7) with ESMTP id QAA13291; Tue, 23 Nov 1999 16:53:40 +0100 (MET) Received: from parate.irisa.fr (parate.irisa.fr [131.254.12.25]) by parasite.irisa.fr (8.9.3/8.9.3) with ESMTP id QAA04418; Tue, 23 Nov 1999 16:53:39 +0100 (MET) Sender: weis To: Damien Doligez Cc: caml-list@inria.fr Subject: Re: [GC] Evaluate memory use References: <199911221924.UAA25229@tobago.inria.fr> From: David.Mentre@irisa.fr (David =?iso-8859-1?q?Mentré?=) Date: 23 Nov 1999 16:53:38 +0100 In-Reply-To: Damien Doligez's message of "Mon, 22 Nov 1999 20:24:33 +0100" Message-ID: User-Agent: Gnus/5.070098 (Pterodactyl Gnus v0.98) Emacs/20.4 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Damien Doligez writes: > 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 ? After thinking about it, both of them. :) But yes, as a safe approximation, the first case would be enough. Something like the maximum of RSS info from ps, but gathered inside my program. > 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. If I've understood the 2.02 doc, the compaction mechanism is disabled by default. Right? So the below method is safe. Right? > >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. Ok. Thanks. [ another stupid attempt ] > > let max_words_total = stats.Gc.minor_words - stats.Gc.promoted_words > > + stats.Gc.heap_words in > > That just doesn't make sense. :) I've never said I've understood the GC mechanism of OCaml. :) I'm more used to the C language. [ other question: wall clock time used by a program ] > > I'm using 'Unix.gettimeofday ()'. > > No, there's nothing simpler. Is it not simple enough ? Oh no. I've managed to use it. :) That's only because I must use the Unix module solely on this purpose. It was just to avoid such use. Thanks a lot for your answers, Best regards, david -- David.Mentre@irisa.fr -- http://www.irisa.fr/prive/dmentre/ Opinions expressed here are only mine.