60 // Get the current non-young occupancy at which concurrent marking should start.
61 virtual size_t get_conc_mark_start_threshold() = 0;
62
63 // Adjust target occupancy.
64 virtual void update_target_occupancy(size_t new_target_occupancy);
65 // Update information about time during which allocations in the Java heap occurred,
66 // how large these allocations were in bytes, and an additional buffer.
67 // The allocations should contain any amount of space made unusable for further
68 // allocation, e.g. any waste caused by TLAB allocation, space at the end of
69 // humongous objects that can not be used for allocation, etc.
70 // Together with the target occupancy, this additional buffer should contain the
71 // difference between old gen size and total heap size at the start of reclamation,
72 // and space required for that reclamation.
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);
130
131 // The "actual" target threshold the algorithm wants to keep during and at the
132 // end of marking. This is typically lower than the requested threshold, as the
133 // algorithm needs to consider restrictions by the environment.
134 size_t actual_target_threshold() const;
135 protected:
136 virtual double last_marking_length_s() const { return _marking_times_s.last(); }
137 public:
138 G1AdaptiveIHOPControl(double ihop_percent,
139 G1Predictions const* predictor,
140 size_t heap_reserve_percent, // The percentage of total heap capacity that should not be tapped into.
141 size_t heap_waste_percent); // The percentage of the free space in the heap that we think is not usable for allocation.
142
143 virtual size_t get_conc_mark_start_threshold();
144
145 virtual void update_allocation_info(double allocation_time_s, size_t allocated_bytes, size_t additional_buffer_size);
146 virtual void update_marking_length(double marking_length_s);
147
148 virtual void print();
149 virtual void send_trace_event(G1NewTracer* tracer);
150 };
151
152 #endif // SHARE_GC_G1_G1IHOPCONTROL_HPP
|
60 // Get the current non-young occupancy at which concurrent marking should start.
61 virtual size_t get_conc_mark_start_threshold() = 0;
62
63 // Adjust target occupancy.
64 virtual void update_target_occupancy(size_t new_target_occupancy);
65 // Update information about time during which allocations in the Java heap occurred,
66 // how large these allocations were in bytes, and an additional buffer.
67 // The allocations should contain any amount of space made unusable for further
68 // allocation, e.g. any waste caused by TLAB allocation, space at the end of
69 // humongous objects that can not be used for allocation, etc.
70 // Together with the target occupancy, this additional buffer should contain the
71 // difference between old gen size and total heap size at the start of reclamation,
72 // and space required for that reclamation.
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 virtual size_t predict_unrestrained_buffer_size() const { return 0; }
82 };
83
84 // The returned concurrent mark starting occupancy threshold is a fixed value
85 // relative to the maximum heap size.
86 class G1StaticIHOPControl : public G1IHOPControl {
87 // Most recent mutator time between the end of initial mark to the start of the
88 // first mixed gc.
89 double _last_marking_length_s;
90 protected:
91 double last_marking_length_s() const { return _last_marking_length_s; }
92 public:
93 G1StaticIHOPControl(double ihop_percent);
94
95 size_t get_conc_mark_start_threshold() {
96 guarantee(_target_occupancy > 0, "Target occupancy must have been initialized.");
97 return (size_t) (_initial_ihop_percent * _target_occupancy / 100.0);
98 }
99
100 virtual void update_marking_length(double marking_length_s) {
101 assert(marking_length_s > 0.0, "Marking length must be larger than zero but is %.3f", marking_length_s);
132
133 // The "actual" target threshold the algorithm wants to keep during and at the
134 // end of marking. This is typically lower than the requested threshold, as the
135 // algorithm needs to consider restrictions by the environment.
136 size_t actual_target_threshold() const;
137 protected:
138 virtual double last_marking_length_s() const { return _marking_times_s.last(); }
139 public:
140 G1AdaptiveIHOPControl(double ihop_percent,
141 G1Predictions const* predictor,
142 size_t heap_reserve_percent, // The percentage of total heap capacity that should not be tapped into.
143 size_t heap_waste_percent); // The percentage of the free space in the heap that we think is not usable for allocation.
144
145 virtual size_t get_conc_mark_start_threshold();
146
147 virtual void update_allocation_info(double allocation_time_s, size_t allocated_bytes, size_t additional_buffer_size);
148 virtual void update_marking_length(double marking_length_s);
149
150 virtual void print();
151 virtual void send_trace_event(G1NewTracer* tracer);
152 virtual size_t predict_unrestrained_buffer_size() const;
153 };
154
155 #endif // SHARE_GC_G1_G1IHOPCONTROL_HPP
|