Hi, is there some way to monitor memory being allocated (and still in use) when calling a function? In the first case below it should report close to 0 and in the second close to 10240. But here it reports 10368 in both cases. Gc.allocated_bytes seems to report allocated bytes without reporting what it was able to free. Have also tried other Gc functions such as Gc.counters. Is it some way to find out which bytes have been allocated and not freed after calling a function? Is there some good methods that people use to find out (get a hint of) which memory is leaking? First: let str = ref "" in Gc.full_major (); let before = Gc.allocated_bytes () in str := String.create 10240; str := ""; Gc.full_major (); let after = Gc.allocated_bytes () in let delta = after -. before in Printf.printf "Bytes used: %f\n%!" delta; Second: Gc.full_major (); let before = Gc.allocated_bytes () in str := String.create 10240; Gc.full_major (); let after = Gc.allocated_bytes () in let delta = after -. before in Printf.printf "Bytes used: %f\n%!" delta; Regards, Hans Ole Rafaelsen