1033 abandon_collection_set(collection_set());
1034
1035 tear_down_region_sets(false /* free_list_only */);
1036
1037 hrm()->prepare_for_full_collection_start();
1038 }
1039
1040 void G1CollectedHeap::verify_before_full_collection(bool explicit_gc) {
1041 assert(!GCCause::is_user_requested_gc(gc_cause()) || explicit_gc, "invariant");
1042 assert_used_and_recalculate_used_equal(this);
1043 _verifier->verify_region_sets_optional();
1044 _verifier->verify_before_gc(G1HeapVerifier::G1VerifyFull);
1045 _verifier->check_bitmaps("Full GC Start");
1046 }
1047
1048 void G1CollectedHeap::prepare_heap_for_mutators() {
1049 hrm()->prepare_for_full_collection_end();
1050
1051 // Delete metaspaces for unloaded class loaders and clean up loader_data graph
1052 ClassLoaderDataGraph::purge();
1053 MetaspaceUtils::verify_metrics();
1054
1055 // Prepare heap for normal collections.
1056 assert(num_free_regions() == 0, "we should not have added any free regions");
1057 rebuild_region_sets(false /* free_list_only */);
1058 abort_refinement();
1059 resize_heap_if_necessary();
1060
1061 // Rebuild the strong code root lists for each region
1062 rebuild_strong_code_roots();
1063
1064 // Purge code root memory
1065 purge_code_root_memory();
1066
1067 // Start a new incremental collection set for the next pause
1068 start_new_collection_set();
1069
1070 _allocator->init_mutator_alloc_region();
1071
1072 // Post collection state updates.
1073 MetaspaceGC::compute_new_size();
|
1033 abandon_collection_set(collection_set());
1034
1035 tear_down_region_sets(false /* free_list_only */);
1036
1037 hrm()->prepare_for_full_collection_start();
1038 }
1039
1040 void G1CollectedHeap::verify_before_full_collection(bool explicit_gc) {
1041 assert(!GCCause::is_user_requested_gc(gc_cause()) || explicit_gc, "invariant");
1042 assert_used_and_recalculate_used_equal(this);
1043 _verifier->verify_region_sets_optional();
1044 _verifier->verify_before_gc(G1HeapVerifier::G1VerifyFull);
1045 _verifier->check_bitmaps("Full GC Start");
1046 }
1047
1048 void G1CollectedHeap::prepare_heap_for_mutators() {
1049 hrm()->prepare_for_full_collection_end();
1050
1051 // Delete metaspaces for unloaded class loaders and clean up loader_data graph
1052 ClassLoaderDataGraph::purge();
1053 DEBUG_ONLY(MetaspaceUtils::verify(false);)
1054
1055 // Prepare heap for normal collections.
1056 assert(num_free_regions() == 0, "we should not have added any free regions");
1057 rebuild_region_sets(false /* free_list_only */);
1058 abort_refinement();
1059 resize_heap_if_necessary();
1060
1061 // Rebuild the strong code root lists for each region
1062 rebuild_strong_code_roots();
1063
1064 // Purge code root memory
1065 purge_code_root_memory();
1066
1067 // Start a new incremental collection set for the next pause
1068 start_new_collection_set();
1069
1070 _allocator->init_mutator_alloc_region();
1071
1072 // Post collection state updates.
1073 MetaspaceGC::compute_new_size();
|