33
33
ShenandoahCollectorPolicy::ShenandoahCollectorPolicy () :
34
34
_success_concurrent_gcs(0 ),
35
35
_mixed_gcs(0 ),
36
- _abbreviated_cycles (0 ),
36
+ _abbreviated_gcs (0 ),
37
37
_success_old_gcs(0 ),
38
38
_interrupted_old_gcs(0 ),
39
39
_success_degenerated_gcs(0 ),
40
40
_success_full_gcs(0 ),
41
41
_consecutive_young_gcs(0 ),
42
+ _consecutive_degenerated_gcs(0 ),
42
43
_alloc_failure_degenerated(0 ),
43
44
_alloc_failure_degenerated_upgrade_to_full(0 ),
44
45
_alloc_failure_full(0 ),
@@ -82,10 +83,12 @@ void ShenandoahCollectorPolicy::record_alloc_failure_to_degenerated(ShenandoahGC
82
83
83
84
void ShenandoahCollectorPolicy::record_degenerated_upgrade_to_full () {
84
85
ShenandoahHeap::heap ()->record_upgrade_to_full ();
86
+ _consecutive_degenerated_gcs = 0 ;
85
87
_alloc_failure_degenerated_upgrade_to_full++;
86
88
}
87
89
88
90
void ShenandoahCollectorPolicy::record_success_concurrent (bool is_young) {
91
+ _consecutive_degenerated_gcs = 0 ;
89
92
if (is_young) {
90
93
_consecutive_young_gcs++;
91
94
} else {
@@ -99,7 +102,7 @@ void ShenandoahCollectorPolicy::record_mixed_cycle() {
99
102
}
100
103
101
104
void ShenandoahCollectorPolicy::record_abbreviated_cycle () {
102
- _abbreviated_cycles ++;
105
+ _abbreviated_gcs ++;
103
106
}
104
107
105
108
void ShenandoahCollectorPolicy::record_success_old () {
@@ -112,7 +115,10 @@ void ShenandoahCollectorPolicy::record_interrupted_old() {
112
115
_interrupted_old_gcs++;
113
116
}
114
117
115
- void ShenandoahCollectorPolicy::record_success_degenerated (bool is_young) {
118
+ void ShenandoahCollectorPolicy::record_success_degenerated (bool is_young, bool is_upgraded_to_full) {
119
+ if (!is_upgraded_to_full) {
120
+ _consecutive_degenerated_gcs++;
121
+ }
116
122
if (is_young) {
117
123
_consecutive_young_gcs++;
118
124
} else {
@@ -122,6 +128,7 @@ void ShenandoahCollectorPolicy::record_success_degenerated(bool is_young) {
122
128
}
123
129
124
130
void ShenandoahCollectorPolicy::record_success_full () {
131
+ _consecutive_degenerated_gcs = 0 ;
125
132
_consecutive_young_gcs = 0 ;
126
133
_success_full_gcs++;
127
134
}
@@ -142,7 +149,6 @@ bool ShenandoahCollectorPolicy::is_at_shutdown() {
142
149
return _in_shutdown.is_set ();
143
150
}
144
151
145
-
146
152
void ShenandoahCollectorPolicy::print_gc_stats (outputStream* out) const {
147
153
out->print_cr (" Under allocation pressure, concurrent cycles may cancel, and either continue cycle" );
148
154
out->print_cr (" under stop-the-world pause or result in stop-the-world Full GC. Increase heap size," );
@@ -172,7 +178,7 @@ void ShenandoahCollectorPolicy::print_gc_stats(outputStream* out) const {
172
178
out->print_cr (" " SIZE_FORMAT_W (5 ) " upgraded to Full GC" , _alloc_failure_degenerated_upgrade_to_full);
173
179
out->cr ();
174
180
175
- out->print_cr (SIZE_FORMAT_W (5 ) " Abbreviated GCs" , _abbreviated_cycles );
181
+ out->print_cr (SIZE_FORMAT_W (5 ) " Abbreviated GCs" , _abbreviated_gcs );
176
182
out->cr ();
177
183
178
184
out->print_cr (SIZE_FORMAT_W (5 ) " Full GCs" , _success_full_gcs + _alloc_failure_degenerated_upgrade_to_full);
0 commit comments