16 * You should have received a copy of the GNU General Public License version
17 * 2 along with this work; if not, write to the Free Software Foundation,
18 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
19 *
20 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
21 * or visit www.oracle.com if you need additional information or have any
22 * questions.
23 *
24 */
25
26 #include "cds/cdsConfig.hpp"
27 #include "gc/g1/g1Arguments.hpp"
28 #include "gc/g1/g1CardSet.hpp"
29 #include "gc/g1/g1CardSetContainers.inline.hpp"
30 #include "gc/g1/g1CollectedHeap.inline.hpp"
31 #include "gc/g1/g1HeapRegion.hpp"
32 #include "gc/g1/g1HeapRegionBounds.inline.hpp"
33 #include "gc/g1/g1HeapRegionRemSet.hpp"
34 #include "gc/g1/g1HeapVerifier.hpp"
35 #include "gc/shared/cardTable.hpp"
36 #include "gc/shared/fullGCForwarding.hpp"
37 #include "gc/shared/gcArguments.hpp"
38 #include "gc/shared/workerPolicy.hpp"
39 #include "runtime/flags/jvmFlagLimit.hpp"
40 #include "runtime/globals.hpp"
41 #include "runtime/globals_extension.hpp"
42 #include "runtime/java.hpp"
43
44 static size_t calculate_heap_alignment(size_t space_alignment) {
45 size_t card_table_alignment = CardTable::ct_max_alignment_constraint();
46 size_t page_size = UseLargePages ? os::large_page_size() : os::vm_page_size();
47 return MAX3(card_table_alignment, space_alignment, page_size);
48 }
49
50 void G1Arguments::initialize_alignments() {
51 // Initialize card size before initializing alignments
52 CardTable::initialize_card_size();
53
54 // Set up the region size and associated fields.
55 //
56 // There is a circular dependency here. We base the region size on the heap
245
246 #ifdef COMPILER2
247 // Enable loop strip mining to offer better pause time guarantees
248 if (FLAG_IS_DEFAULT(UseCountedLoopSafepoints)) {
249 FLAG_SET_DEFAULT(UseCountedLoopSafepoints, true);
250 if (FLAG_IS_DEFAULT(LoopStripMiningIter)) {
251 FLAG_SET_DEFAULT(LoopStripMiningIter, 1000);
252 }
253 }
254 #endif
255
256 initialize_mark_stack_size();
257 initialize_verification_types();
258
259 // Verify that the maximum parallelism isn't too high to eventually overflow
260 // the refcount in G1CardSetContainer.
261 uint const divisor = 3; // Safe divisor; we increment by 2 for each claim, but there is a small initial value.
262 if (G1ConcRefinementThreads > UINT_MAX / divisor) {
263 vm_exit_during_initialization("Too large parallelism for remembered sets.");
264 }
265
266 FullGCForwarding::initialize_flags(heap_reserved_size_bytes());
267 }
268
269 CollectedHeap* G1Arguments::create_heap() {
270 return new G1CollectedHeap();
271 }
272
273 size_t G1Arguments::heap_reserved_size_bytes() {
274 return MaxHeapSize;
275 }
|
16 * You should have received a copy of the GNU General Public License version
17 * 2 along with this work; if not, write to the Free Software Foundation,
18 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
19 *
20 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
21 * or visit www.oracle.com if you need additional information or have any
22 * questions.
23 *
24 */
25
26 #include "cds/cdsConfig.hpp"
27 #include "gc/g1/g1Arguments.hpp"
28 #include "gc/g1/g1CardSet.hpp"
29 #include "gc/g1/g1CardSetContainers.inline.hpp"
30 #include "gc/g1/g1CollectedHeap.inline.hpp"
31 #include "gc/g1/g1HeapRegion.hpp"
32 #include "gc/g1/g1HeapRegionBounds.inline.hpp"
33 #include "gc/g1/g1HeapRegionRemSet.hpp"
34 #include "gc/g1/g1HeapVerifier.hpp"
35 #include "gc/shared/cardTable.hpp"
36 #include "gc/shared/gcArguments.hpp"
37 #include "gc/shared/workerPolicy.hpp"
38 #include "runtime/flags/jvmFlagLimit.hpp"
39 #include "runtime/globals.hpp"
40 #include "runtime/globals_extension.hpp"
41 #include "runtime/java.hpp"
42
43 static size_t calculate_heap_alignment(size_t space_alignment) {
44 size_t card_table_alignment = CardTable::ct_max_alignment_constraint();
45 size_t page_size = UseLargePages ? os::large_page_size() : os::vm_page_size();
46 return MAX3(card_table_alignment, space_alignment, page_size);
47 }
48
49 void G1Arguments::initialize_alignments() {
50 // Initialize card size before initializing alignments
51 CardTable::initialize_card_size();
52
53 // Set up the region size and associated fields.
54 //
55 // There is a circular dependency here. We base the region size on the heap
244
245 #ifdef COMPILER2
246 // Enable loop strip mining to offer better pause time guarantees
247 if (FLAG_IS_DEFAULT(UseCountedLoopSafepoints)) {
248 FLAG_SET_DEFAULT(UseCountedLoopSafepoints, true);
249 if (FLAG_IS_DEFAULT(LoopStripMiningIter)) {
250 FLAG_SET_DEFAULT(LoopStripMiningIter, 1000);
251 }
252 }
253 #endif
254
255 initialize_mark_stack_size();
256 initialize_verification_types();
257
258 // Verify that the maximum parallelism isn't too high to eventually overflow
259 // the refcount in G1CardSetContainer.
260 uint const divisor = 3; // Safe divisor; we increment by 2 for each claim, but there is a small initial value.
261 if (G1ConcRefinementThreads > UINT_MAX / divisor) {
262 vm_exit_during_initialization("Too large parallelism for remembered sets.");
263 }
264 }
265
266 CollectedHeap* G1Arguments::create_heap() {
267 return new G1CollectedHeap();
268 }
269
270 size_t G1Arguments::heap_reserved_size_bytes() {
271 return MaxHeapSize;
272 }
|