Преглед изворни кода

[memory] set some hardcore GC values before compacting in memory inspection

see #8415
Simon Krajewski пре 6 година
родитељ
комит
456434674e
1 измењених фајлова са 6 додато и 0 уклоњено
  1. 6 0
      src/context/memory.ml

+ 6 - 0
src/context/memory.ml

@@ -93,7 +93,13 @@ let size v =
 let get_memory_json (cs : CompilationServer.t) mreq =
 	begin match mreq with
 	| MCache ->
+		let old_gc = Gc.get() in
+		Gc.set { old_gc with
+			Gc.max_overhead = 0;
+			Gc.space_overhead = 0
+		};
 		Gc.compact();
+		Gc.set old_gc;
 		let stat = Gc.quick_stat() in
 		let size = (float_of_int stat.Gc.heap_words) *. (float_of_int (Sys.word_size / 8)) in
 		let cache_mem = cs#get_pointers in