diff --git a/mmtk/src/api.rs b/mmtk/src/api.rs index 37002a7..414a160 100644 --- a/mmtk/src/api.rs +++ b/mmtk/src/api.rs @@ -101,6 +101,11 @@ pub extern "C" fn mmtk_gc_init( let success = builder.options.threads.set(n_gcthreads); assert!(success, "Failed to set GC threads to {}", n_gcthreads); } + + if cfg!(feature = "print_fragmentation") { + let success = builder.options.count_live_bytes_in_gc.set(true); + assert!(success, "Failed to enable live byte counting in GC"); + } } // Make sure that we haven't initialized MMTk (by accident) yet @@ -643,7 +648,7 @@ pub extern "C" fn get_mmtk_version() -> *const c_char { pub extern "C" fn print_fragmentation() { let map = memory_manager::live_bytes_in_last_gc(&SINGLETON); for (space, stats) in map { - println!( + eprintln!( "Utilization in space {:?}: {} live bytes, {} total bytes, {:.2} %", space, stats.live_bytes,