From: David.Mentre@irisa.fr (David Mentré)
To: <Emmanuel.Dorlet@cea.fr>
Cc: "Liste-Caml" <caml-list@inria.fr>
Subject: Re: Memory usage
Date: 28 Jun 2000 14:49:45 +0200 [thread overview]
Message-ID: <wd8lmzq6kd2.fsf@parate.irisa.fr> (raw)
In-Reply-To: "Dorlet Emmanuel"'s message of "Mon, 26 Jun 2000 15:28:59 +0200"
"Dorlet Emmanuel" <Emmanuel.Dorlet@cea.fr> 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.
next prev parent reply other threads:[~2000-06-28 15:46 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-06-26 13:28 Dorlet Emmanuel
2000-06-28 12:49 ` David Mentré [this message]
2008-07-11 19:49 memory usage Jean Krivine
2009-01-12 7:41 John Lepikhin
2009-01-12 8:39 ` [Caml-list] " Richard Jones
2009-01-12 9:14 ` John Lepikhin
2009-01-12 10:45 ` Sylvain Le Gall
2009-01-12 16:29 ` [Caml-list] " Florian Hars
2009-01-12 16:44 ` John Lepikhin
2009-01-12 17:55 ` Sylvain Le Gall
2009-01-12 18:01 ` [Caml-list] " John Lepikhin
2009-01-12 18:26 ` Sylvain Le Gall
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=wd8lmzq6kd2.fsf@parate.irisa.fr \
--to=david.mentre@irisa.fr \
--cc=Emmanuel.Dorlet@cea.fr \
--cc=caml-list@inria.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).