Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- open Gc
- let alloc n =
- let _ = String.make n '4' in
- ()
- let process_stuff () = ()
- let rec main n =
- print_endline (string_of_int n);
- alloc n;
- let sb = stat () in
- Printf.printf "Before: %d, %d\n" sb.heap_words sb.live_words;
- Gc.compact ();
- Gc.full_major ();
- let sa = stat () in
- Printf.printf " After: %d, %d\n" sa.heap_words sa.live_words;
- process_stuff ();
- let _ = read_line () in
- main (n * 2)
- let _ = main (1 lsl 28)
Add Comment
Please, Sign In to add comment