8365026: G1: Initialization should start a "full" new collection set

Reviewed-by: ayang, kbarrett
This commit is contained in:
Thomas Schatzl 2025-08-21 09:37:34 +00:00
parent f0e706698d
commit ed260e8cae
3 changed files with 4 additions and 5 deletions

View File

@ -1487,6 +1487,8 @@ jint G1CollectedHeap::initialize() {
_collection_set.initialize(max_num_regions());
start_new_collection_set();
allocation_failure_injector()->reset();
CPUTimeCounters::create_counter(CPUTimeGroups::CPUTimeType::gc_parallel_workers);

View File

@ -1962,7 +1962,8 @@ public:
};
void G1ConcurrentMark::verify_no_collection_set_oops() {
assert(SafepointSynchronize::is_at_safepoint(), "should be at a safepoint");
assert(SafepointSynchronize::is_at_safepoint() || !is_init_completed(),
"should be at a safepoint or initializing");
if (!_g1h->collector_state()->mark_or_rebuild_in_progress()) {
return;
}

View File

@ -97,10 +97,6 @@ void G1Policy::init(G1CollectedHeap* g1h, G1CollectionSet* collection_set) {
_free_regions_at_end_of_collection = _g1h->num_free_regions();
update_young_length_bounds();
// We immediately start allocating regions placing them in the collection set.
// Initialize the collection set info.
_collection_set->start_incremental_building();
}
void G1Policy::record_young_gc_pause_start() {