135
136 DEBUG_ONLY(CollectorPolicy::assert_flags();)
137 }
138
139 void CollectorPolicy::initialize_size_info() {
140 if (PrintGCDetails && Verbose) {
141 gclog_or_tty->print_cr("Minimum heap " SIZE_FORMAT " Initial heap "
142 SIZE_FORMAT " Maximum heap " SIZE_FORMAT,
143 _min_heap_byte_size, _initial_heap_byte_size, _max_heap_byte_size);
144 }
145
146 DEBUG_ONLY(CollectorPolicy::assert_size_info();)
147 }
148
149 bool CollectorPolicy::use_should_clear_all_soft_refs(bool v) {
150 bool result = _should_clear_all_soft_refs;
151 set_should_clear_all_soft_refs(false);
152 return result;
153 }
154
155 GenRemSet* CollectorPolicy::create_rem_set(MemRegion whole_heap,
156 int max_covered_regions) {
157 return new CardTableRS(whole_heap, max_covered_regions);
158 }
159
160 void CollectorPolicy::cleared_all_soft_refs() {
161 // If near gc overhear limit, continue to clear SoftRefs. SoftRefs may
162 // have been cleared in the last collection but if the gc overhear
163 // limit continues to be near, SoftRefs should still be cleared.
164 if (size_policy() != NULL) {
165 _should_clear_all_soft_refs = size_policy()->gc_overhead_limit_near();
166 }
167 _all_soft_refs_clear = true;
168 }
169
170 size_t CollectorPolicy::compute_heap_alignment() {
171 // The card marking array and the offset arrays for old generations are
172 // committed in os pages as well. Make sure they are entirely full (to
173 // avoid partial page problems), e.g. if 512 bytes heap corresponds to 1
174 // byte entry and the os page size is 4096, the maximum heap size should
175 // be 512*4096 = 2MB aligned.
176
177 size_t alignment = GenRemSet::max_alignment_constraint();
|
135
136 DEBUG_ONLY(CollectorPolicy::assert_flags();)
137 }
138
139 void CollectorPolicy::initialize_size_info() {
140 if (PrintGCDetails && Verbose) {
141 gclog_or_tty->print_cr("Minimum heap " SIZE_FORMAT " Initial heap "
142 SIZE_FORMAT " Maximum heap " SIZE_FORMAT,
143 _min_heap_byte_size, _initial_heap_byte_size, _max_heap_byte_size);
144 }
145
146 DEBUG_ONLY(CollectorPolicy::assert_size_info();)
147 }
148
149 bool CollectorPolicy::use_should_clear_all_soft_refs(bool v) {
150 bool result = _should_clear_all_soft_refs;
151 set_should_clear_all_soft_refs(false);
152 return result;
153 }
154
155 GenRemSet* CollectorPolicy::create_rem_set(MemRegion whole_heap) {
156 return new CardTableRS(whole_heap);
157 }
158
159 void CollectorPolicy::cleared_all_soft_refs() {
160 // If near gc overhear limit, continue to clear SoftRefs. SoftRefs may
161 // have been cleared in the last collection but if the gc overhear
162 // limit continues to be near, SoftRefs should still be cleared.
163 if (size_policy() != NULL) {
164 _should_clear_all_soft_refs = size_policy()->gc_overhead_limit_near();
165 }
166 _all_soft_refs_clear = true;
167 }
168
169 size_t CollectorPolicy::compute_heap_alignment() {
170 // The card marking array and the offset arrays for old generations are
171 // committed in os pages as well. Make sure they are entirely full (to
172 // avoid partial page problems), e.g. if 512 bytes heap corresponds to 1
173 // byte entry and the os page size is 4096, the maximum heap size should
174 // be 512*4096 = 2MB aligned.
175
176 size_t alignment = GenRemSet::max_alignment_constraint();
|