73 virtual void update_allocation_info(double allocation_time_s, size_t allocated_bytes, size_t additional_buffer_size);
74 // Update the time spent in the mutator beginning from the end of initial mark to
75 // the first mixed gc.
76 virtual void update_marking_length(double marking_length_s) = 0;
77
78 virtual void print();
79 virtual void send_trace_event(G1NewTracer* tracer);
80 };
81
82 // The returned concurrent mark starting occupancy threshold is a fixed value
83 // relative to the maximum heap size.
84 class G1StaticIHOPControl : public G1IHOPControl {
85 // Most recent mutator time between the end of initial mark to the start of the
86 // first mixed gc.
87 double _last_marking_length_s;
88 protected:
89 double last_marking_length_s() const { return _last_marking_length_s; }
90 public:
91 G1StaticIHOPControl(double ihop_percent);
92
93 size_t get_conc_mark_start_threshold() {
94 guarantee(_target_occupancy > 0, "Target occupancy must have been initialized.");
95 return (size_t) (_initial_ihop_percent * _target_occupancy / 100.0);
96 }
97
98 virtual void update_marking_length(double marking_length_s) {
99 assert(marking_length_s > 0.0, "Marking length must be larger than zero but is %.3f", marking_length_s);
100 _last_marking_length_s = marking_length_s;
101 }
102 };
103
104 // This algorithm tries to return a concurrent mark starting occupancy value that
105 // makes sure that during marking the given target occupancy is never exceeded,
106 // based on predictions of current allocation rate and time periods between
107 // initial mark and the first mixed gc.
108 class G1AdaptiveIHOPControl : public G1IHOPControl {
109 size_t _heap_reserve_percent; // Percentage of maximum heap capacity we should avoid to touch
110 size_t _heap_waste_percent; // Percentage of free heap that should be considered as waste.
111
112 const G1Predictions * _predictor;
113
114 TruncatedSeq _marking_times_s;
115 TruncatedSeq _allocation_rate_s;
116
|
73 virtual void update_allocation_info(double allocation_time_s, size_t allocated_bytes, size_t additional_buffer_size);
74 // Update the time spent in the mutator beginning from the end of initial mark to
75 // the first mixed gc.
76 virtual void update_marking_length(double marking_length_s) = 0;
77
78 virtual void print();
79 virtual void send_trace_event(G1NewTracer* tracer);
80 };
81
82 // The returned concurrent mark starting occupancy threshold is a fixed value
83 // relative to the maximum heap size.
84 class G1StaticIHOPControl : public G1IHOPControl {
85 // Most recent mutator time between the end of initial mark to the start of the
86 // first mixed gc.
87 double _last_marking_length_s;
88 protected:
89 double last_marking_length_s() const { return _last_marking_length_s; }
90 public:
91 G1StaticIHOPControl(double ihop_percent);
92
93 size_t get_conc_mark_start_threshold();
94
95 virtual void update_marking_length(double marking_length_s) {
96 assert(marking_length_s > 0.0, "Marking length must be larger than zero but is %.3f", marking_length_s);
97 _last_marking_length_s = marking_length_s;
98 }
99 };
100
101 // This algorithm tries to return a concurrent mark starting occupancy value that
102 // makes sure that during marking the given target occupancy is never exceeded,
103 // based on predictions of current allocation rate and time periods between
104 // initial mark and the first mixed gc.
105 class G1AdaptiveIHOPControl : public G1IHOPControl {
106 size_t _heap_reserve_percent; // Percentage of maximum heap capacity we should avoid to touch
107 size_t _heap_waste_percent; // Percentage of free heap that should be considered as waste.
108
109 const G1Predictions * _predictor;
110
111 TruncatedSeq _marking_times_s;
112 TruncatedSeq _allocation_rate_s;
113
|