@@ -2975,7 +2975,6 @@ G1CMTask::G1CMTask(uint worker_id,
29752975#define G1PPRL_BYTE_FORMAT " %9zu"
29762976#define G1PPRL_BYTE_H_FORMAT " %9s"
29772977#define G1PPRL_DOUBLE_FORMAT " %14.1f"
2978- #define G1PPRL_GCEFF_FORMAT " %14s"
29792978#define G1PPRL_GCEFF_H_FORMAT " %14s"
29802979#define G1PPRL_GID_H_FORMAT " %9s"
29812980#define G1PPRL_GID_FORMAT " " UINT32_FORMAT_W(9 )
@@ -3090,7 +3089,7 @@ G1PrintRegionLivenessInfoClosure::~G1PrintRegionLivenessInfoClosure() {
30903089 // add static memory usages to remembered set sizes
30913090 _total_remset_bytes += G1HeapRegionRemSet::static_mem_size ();
30923091
3093- do_cset_groups ();
3092+ log_cset_candidate_groups ();
30943093
30953094 // Print the footer of the output.
30963095 log_trace (gc, liveness)(G1PPRL_LINE_PREFIX);
@@ -3110,10 +3109,33 @@ G1PrintRegionLivenessInfoClosure::~G1PrintRegionLivenessInfoClosure() {
31103109 bytes_to_mb (_total_code_roots_bytes));
31113110}
31123111
3113- void G1PrintRegionLivenessInfoClosure::do_cset_groups () {
3112+ void G1PrintRegionLivenessInfoClosure::log_cset_candidate_group_add_total (G1CSetCandidateGroup* group, const char * type) {
3113+ log_trace (gc, liveness)(G1PPRL_LINE_PREFIX
3114+ G1PPRL_GID_FORMAT
3115+ G1PPRL_LEN_FORMAT
3116+ G1PPRL_GID_GCEFF_FORMAT
3117+ G1PPRL_BYTE_FORMAT
3118+ G1PPRL_BYTE_FORMAT
3119+ G1PPRL_TYPE_H_FORMAT,
3120+ group->group_id (),
3121+ group->length (),
3122+ group->gc_efficiency (),
3123+ group->liveness (),
3124+ group->card_set ()->mem_size (),
3125+ type);
3126+ _total_remset_bytes += group->card_set ()->mem_size ();
3127+ }
3128+
3129+ void G1PrintRegionLivenessInfoClosure::log_cset_candidate_grouplist (G1CSetCandidateGroupList& gl, const char * type) {
3130+ for (G1CSetCandidateGroup* group : gl) {
3131+ log_cset_candidate_group_add_total (group, type);
3132+ }
3133+ }
3134+
3135+ void G1PrintRegionLivenessInfoClosure::log_cset_candidate_groups () {
31143136 log_trace (gc, liveness)(G1PPRL_LINE_PREFIX);
3115- log_trace (gc, liveness)(G1PPRL_LINE_PREFIX" Collectionset Candidate Groups" );
3116- log_trace (gc, liveness)(G1PPRL_LINE_PREFIX " Types: Y=Young Regions , M=From Marking Regions, R=Retained Regions" );
3137+ log_trace (gc, liveness)(G1PPRL_LINE_PREFIX" Collection Set Candidate Groups" );
3138+ log_trace (gc, liveness)(G1PPRL_LINE_PREFIX " Types: Y=Young, M=From Marking Regions, R=Retained Regions" );
31173139 log_trace (gc, liveness)(G1PPRL_LINE_PREFIX
31183140 G1PPRL_GID_H_FORMAT
31193141 G1PPRL_LEN_H_FORMAT
@@ -3137,49 +3159,10 @@ void G1PrintRegionLivenessInfoClosure::do_cset_groups() {
31373159 " (bytes)" , " " );
31383160
31393161 G1CollectedHeap* g1h = G1CollectedHeap::heap ();
3140- G1CSetCandidateGroup* young_only_cset_group =g1h->young_regions_cset_group ();
31413162
3142- _total_remset_bytes += young_only_cset_group-> card_set ()-> mem_size ( );
3163+ log_cset_candidate_group_add_total (g1h-> young_regions_cset_group (), " Y " );
31433164
3144- log_trace (gc, liveness)(G1PPRL_LINE_PREFIX
3145- G1PPRL_GID_FORMAT
3146- G1PPRL_LEN_FORMAT
3147- G1PPRL_GCEFF_FORMAT
3148- G1PPRL_BYTE_FORMAT
3149- G1PPRL_BYTE_FORMAT
3150- G1PPRL_TYPE_H_FORMAT,
3151- young_only_cset_group->group_id (), young_only_cset_group->length (),
3152- " -" ,
3153- size_t (0 ), young_only_cset_group->card_set ()->mem_size (),
3154- " Y" );
3155-
3156- for (G1CSetCandidateGroup* group : g1h->policy ()->candidates ()->from_marking_groups ()) {
3157- _total_remset_bytes += group->card_set ()->mem_size ();
3158- log_trace (gc, liveness)(G1PPRL_LINE_PREFIX
3159- G1PPRL_GID_FORMAT
3160- G1PPRL_LEN_FORMAT
3161- G1PPRL_GID_GCEFF_FORMAT
3162- G1PPRL_BYTE_FORMAT
3163- G1PPRL_BYTE_FORMAT
3164- G1PPRL_TYPE_H_FORMAT,
3165- group->group_id (), group->length (),
3166- group->gc_efficiency (),
3167- group->liveness (), group->card_set ()->mem_size (),
3168- " M" );
3169- }
3170-
3171- for (G1CSetCandidateGroup* group : g1h->policy ()->candidates ()->retained_groups ()) {
3172- _total_remset_bytes += group->card_set ()->mem_size ();
3173- log_trace (gc, liveness)(G1PPRL_LINE_PREFIX
3174- G1PPRL_GID_FORMAT
3175- G1PPRL_LEN_FORMAT
3176- G1PPRL_GID_GCEFF_FORMAT
3177- G1PPRL_BYTE_FORMAT
3178- G1PPRL_BYTE_FORMAT
3179- G1PPRL_TYPE_H_FORMAT,
3180- group->group_id (), group->length (),
3181- group->gc_efficiency (),
3182- group->liveness (), group->card_set ()->mem_size (),
3183- " R" );
3184- }
3165+ G1CollectionSetCandidates* candidates = g1h->policy ()->candidates ();
3166+ log_cset_candidate_grouplist (candidates->from_marking_groups (), " M" );
3167+ log_cset_candidate_grouplist (candidates->retained_groups (), " R" );
31853168}
0 commit comments