From 734ae14ef6a527eb83ef164a0692362f8767dbea Mon Sep 17 00:00:00 2001 From: Claudio Sacerdoti Coen Date: Tue, 11 Apr 2006 10:02:32 +0000 Subject: [PATCH] CicEnvironment is emptied when a size treshold is reached. --- components/binaries/utilities/test_library.ml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/components/binaries/utilities/test_library.ml b/components/binaries/utilities/test_library.ml index 5cfb7c348..635b6bbd4 100644 --- a/components/binaries/utilities/test_library.ml +++ b/components/binaries/utilities/test_library.ml @@ -87,6 +87,15 @@ let _ = ignore (Unix.alarm deadline); ignore (CicTypeChecker.typecheck uri); ignore (Unix.alarm 0); + let memusage = (Gc.stat ()).Gc.live_words * 4 / 1024 / 1024 in + if memusage > 500 then + begin + prerr_endline ("MEMORIA ALLOCATA: " ^ string_of_int memusage ^ "Mb"); + CicEnvironment.empty (); + Gc.compact (); + let memusage = (Gc.stat ()).Gc.live_words * 4 / 1024 / 1024 in + prerr_endline ("DOPO CicEnvironment.empty: " ^ string_of_int memusage ^ "Mb"); + end; let after = Unix.gettimeofday () in let diff = after -. before in new_total := !new_total +. diff; -- 2.39.2