< prev index next >
src/share/vm/gc/g1/g1DefaultPolicy.cpp
Print this page
rev 11906 : [mq]: 8164936-age-table-print-wrong
@@ -883,10 +883,19 @@
bool G1DefaultPolicy::adaptive_young_list_length() const {
return _young_gen_sizer.adaptive_young_list_length();
}
+size_t G1DefaultPolicy::desired_survivor_size() const {
+ size_t const survivor_capacity = HeapRegion::GrainWords * _max_survivor_regions;
+ return (size_t)((((double)survivor_capacity) * TargetSurvivorRatio) / 100);
+}
+
+void G1DefaultPolicy::print_age_table() {
+ _survivors_age_table.print_age_table(_tenuring_threshold);
+}
+
void G1DefaultPolicy::update_max_gc_locker_expansion() {
uint expansion_region_num = 0;
if (GCLockerEdenExpansionPercent > 0) {
double perc = (double) GCLockerEdenExpansionPercent / 100.0;
double expansion_region_num_d = perc * (double) _young_list_target_length;
@@ -906,12 +915,15 @@
(double) _young_list_target_length / (double) SurvivorRatio;
// We use ceiling so that if max_survivor_regions_d is > 0.0 (but
// smaller than 1.0) we'll get 1.
_max_survivor_regions = (uint) ceil(max_survivor_regions_d);
- _tenuring_threshold = _survivors_age_table.compute_tenuring_threshold(
- HeapRegion::GrainWords * _max_survivor_regions, _policy_counters);
+ _tenuring_threshold = _survivors_age_table.compute_tenuring_threshold(desired_survivor_size());
+ if (UsePerfData) {
+ _policy_counters->tenuring_threshold()->set_value(_tenuring_threshold);
+ _policy_counters->desired_survivor_size()->set_value(desired_survivor_size() * oopSize);
+ }
}
bool G1DefaultPolicy::force_initial_mark_if_outside_cycle(GCCause::Cause gc_cause) {
// We actually check whether we are marking here and not if we are in a
// reclamation phase. This means that we will schedule a concurrent mark
< prev index next >