Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/policy/immix/defrag.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,15 @@ impl Defrag {
exhausted_reusable_space: bool,
full_heap_system_gc: bool,
stress_defrag: bool,
immix_util: Option<f64>,
) {
let in_defrag = defrag_enabled
&& (emergency_collection
|| (collection_attempts > 1)
|| !exhausted_reusable_space
|| stress_defrag
|| (collect_whole_heap && user_triggered && full_heap_system_gc));
|| (collect_whole_heap && user_triggered && full_heap_system_gc))
|| (immix_util.is_some() && immix_util.unwrap() < 0.2);
info!("Defrag: {}", in_defrag);
probe!(mmtk, immix_defrag, in_defrag);
self.in_defrag_collection
Expand Down
10 changes: 10 additions & 0 deletions src/policy/immix/immixspace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,16 @@ impl<VM: VMBinding> ImmixSpace<VM> {
self.reusable_blocks.len() == 0,
full_heap_system_gc,
*self.common.options.immix_always_defrag,
if *self.common.options.count_live_bytes_in_gc {
let stats = self.common.global_state.live_bytes_in_last_gc.borrow();
if let Some(immix_stats) = stats.get(&self.name()) {
Some(immix_stats.live_bytes as f64 / immix_stats.used_bytes as f64)
} else {
None
}
} else {
None
}
);
self.defrag.in_defrag()
}
Expand Down
Loading