diff options
author | filliatr <filliatr@85f007b7-540e-0410-9357-904b9bb8a0f7> | 2001-02-09 12:34:50 +0000 |
---|---|---|
committer | filliatr <filliatr@85f007b7-540e-0410-9357-904b9bb8a0f7> | 2001-02-09 12:34:50 +0000 |
commit | 6deabbf444b77daa17ef4404ecc08558cff33ab6 (patch) | |
tree | 05e0726c0f2b5007232ef20c775d7c56349b96e1 /lib/util.ml | |
parent | d72efb0925569f66506348f9886003e003bde7e8 (diff) |
option -m (utilisation memoire)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@1366 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'lib/util.ml')
-rw-r--r-- | lib/util.ml | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/util.ml b/lib/util.ml index b5611c50b..a51839993 100644 --- a/lib/util.ml +++ b/lib/util.ml @@ -561,4 +561,12 @@ let size_w = Size.size_w let size_b = Size.size_b let size_kb = Size.size_kb +(*s Total size of the allocated ocaml heap. *) +let heap_size () = + let stat = Gc.stat () + and control = Gc.get () in + let max_words_total = stat.Gc.heap_words + control.Gc.minor_heap_size in + (max_words_total * Sys.word_size / 8) + +let heap_size_kb () = (heap_size () + 1023) / 1024 |