Skip to content
Permalink
Browse files
8264026: Remove dependency between free collection set and eagerly re…
…claim humongous object tasks

Reviewed-by: sjohanss, ayang
  • Loading branch information
Thomas Schatzl committed Mar 24, 2021
1 parent deda80f commit 3aee5ad2dd58f1d0c68ff6aaaacfeb69cf639a18
Showing 2 changed files with 12 additions and 7 deletions.
@@ -3979,6 +3979,8 @@ void G1CollectedHeap::post_evacuate_collection_set(G1EvacuationInfo& evacuation_

eagerly_reclaim_humongous_regions();

rebuild_free_region_list();

record_obj_copy_mem_stats();

evacuation_info.set_collectionset_used_before(collection_set()->bytes_used_before());
@@ -4330,21 +4332,17 @@ void G1CollectedHeap::free_collection_set(G1CollectionSet* collection_set, G1Eva
Ticks free_cset_end_time = Ticks::now();
phase_times()->record_total_free_cset_time_ms((free_cset_end_time - free_cset_start_time).seconds() * 1000.0);

// Now rebuild the free region list.
_hrm.rebuild_free_list(workers());
phase_times()->record_total_rebuild_freelist_time_ms((Ticks::now() - free_cset_end_time).seconds() * 1000.0);

collection_set->clear();
}

class G1FreeHumongousRegionClosure : public HeapRegionClosure {
private:
private:
FreeRegionList* _free_region_list;
HeapRegionSet* _proxy_set;
uint _humongous_objects_reclaimed;
uint _humongous_regions_reclaimed;
size_t _freed_bytes;
public:
public:

G1FreeHumongousRegionClosure(FreeRegionList* free_region_list) :
_free_region_list(free_region_list), _proxy_set(NULL), _humongous_objects_reclaimed(0), _humongous_regions_reclaimed(0), _freed_bytes(0) {
@@ -4479,13 +4477,18 @@ void G1CollectedHeap::eagerly_reclaim_humongous_regions() {
}
}

prepend_to_freelist(&local_cleanup_list);
decrement_summary_bytes(cl.bytes_freed());

phase_times()->record_fast_reclaim_humongous_time_ms((os::elapsedTime() - start_time) * 1000.0,
cl.humongous_objects_reclaimed());
}

void G1CollectedHeap::rebuild_free_region_list() {
Ticks start = Ticks::now();
_hrm.rebuild_free_list(workers());
phase_times()->record_total_rebuild_freelist_time_ms((Ticks::now() - start).seconds() * 1000.0);
}

class G1AbandonCollectionSetClosure : public HeapRegionClosure {
public:
virtual bool do_heap_region(HeapRegion* r) {
@@ -172,6 +172,8 @@ class G1CollectedHeap : public CollectedHeap {
HeapRegionSet _humongous_set;

void eagerly_reclaim_humongous_regions();

void rebuild_free_region_list();
// Start a new incremental collection set for the next pause.
void start_new_collection_set();

0 comments on commit 3aee5ad

Please sign in to comment.