144
145 // When it's appropriate to recalculate the various sizes (at the
146 // end of a GC, when a new eden region is allocated, etc.) we store
147 // them here so that we can easily report them when needed and not
148 // have to recalculate them every time.
149
150 size_t _overall_reserved;
151 size_t _overall_committed;
152 size_t _overall_used;
153
154 uint _young_region_num;
155 size_t _young_gen_committed;
156 size_t _eden_committed;
157 size_t _eden_used;
158 size_t _survivor_committed;
159 size_t _survivor_used;
160
161 size_t _old_committed;
162 size_t _old_used;
163
164 G1CollectedHeap* g1h() { return _g1h; }
165
166 // It returns x - y if x > y, 0 otherwise.
167 // As described in the comment above, some of the inputs to the
168 // calculations we have to do are obtained concurrently and hence
169 // may be inconsistent with each other. So, this provides a
170 // defensive way of performing the subtraction and avoids the value
171 // going negative (which would mean a very large result, given that
172 // the parameter are size_t).
173 static size_t subtract_up_to_zero(size_t x, size_t y) {
174 if (x > y) {
175 return x - y;
176 } else {
177 return 0;
178 }
179 }
180
181 // Recalculate all the sizes.
182 void recalculate_sizes();
183 // Recalculate only what's necessary when a new eden region is allocated.
184 void recalculate_eden_size();
185
|
144
145 // When it's appropriate to recalculate the various sizes (at the
146 // end of a GC, when a new eden region is allocated, etc.) we store
147 // them here so that we can easily report them when needed and not
148 // have to recalculate them every time.
149
150 size_t _overall_reserved;
151 size_t _overall_committed;
152 size_t _overall_used;
153
154 uint _young_region_num;
155 size_t _young_gen_committed;
156 size_t _eden_committed;
157 size_t _eden_used;
158 size_t _survivor_committed;
159 size_t _survivor_used;
160
161 size_t _old_committed;
162 size_t _old_used;
163
164 // It returns x - y if x > y, 0 otherwise.
165 // As described in the comment above, some of the inputs to the
166 // calculations we have to do are obtained concurrently and hence
167 // may be inconsistent with each other. So, this provides a
168 // defensive way of performing the subtraction and avoids the value
169 // going negative (which would mean a very large result, given that
170 // the parameter are size_t).
171 static size_t subtract_up_to_zero(size_t x, size_t y) {
172 if (x > y) {
173 return x - y;
174 } else {
175 return 0;
176 }
177 }
178
179 // Recalculate all the sizes.
180 void recalculate_sizes();
181 // Recalculate only what's necessary when a new eden region is allocated.
182 void recalculate_eden_size();
183
|