[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | David.Mentre@i... |
| Subject: | Re: Memory usage |
"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.