< prev index next >

src/share/vm/runtime/arguments.cpp

Print this page
rev 8148 : 8068582: UseSerialGC not always set up properly
Reviewed-by:


1538 #if INCLUDE_ALL_GCS
1539   if (UseParallelGC) {
1540     heap_alignment = ParallelScavengeHeap::conservative_max_heap_alignment();
1541   } else if (UseG1GC) {
1542     heap_alignment = G1CollectedHeap::conservative_max_heap_alignment();
1543   }
1544 #endif // INCLUDE_ALL_GCS
1545   _conservative_max_heap_alignment = MAX4(heap_alignment,
1546                                           (size_t)os::vm_allocation_granularity(),
1547                                           os::max_page_size(),
1548                                           CollectorPolicy::compute_heap_alignment());
1549 }
1550 
1551 void Arguments::select_gc_ergonomically() {
1552   if (os::is_server_class_machine()) {
1553     if (should_auto_select_low_pause_collector()) {
1554       FLAG_SET_ERGO(bool, UseConcMarkSweepGC, true);
1555     } else {
1556       FLAG_SET_ERGO(bool, UseParallelGC, true);
1557     }


1558   }
1559 }
1560 
1561 void Arguments::select_gc() {
1562   if (!gc_selected()) {
1563     select_gc_ergonomically();

1564   }
1565 }
1566 
1567 void Arguments::set_ergonomics_flags() {
1568   select_gc();
1569 
1570 #ifdef COMPILER2
1571   // Shared spaces work fine with other GCs but causes bytecode rewriting
1572   // to be disabled, which hurts interpreter performance and decreases
1573   // server performance.  When -server is specified, keep the default off
1574   // unless it is asked for.  Future work: either add bytecode rewriting
1575   // at link time, or rewrite bytecodes in non-shared methods.
1576   if (!DumpSharedSpaces && !RequireSharedSpaces &&
1577       (FLAG_IS_DEFAULT(UseSharedSpaces) || !UseSharedSpaces)) {
1578     no_shared_spaces("COMPILER2 default: -Xshare:auto | off, have to manually setup to on.");
1579   }
1580 #endif
1581 
1582   set_conservative_max_heap_alignment();
1583 




1538 #if INCLUDE_ALL_GCS
1539   if (UseParallelGC) {
1540     heap_alignment = ParallelScavengeHeap::conservative_max_heap_alignment();
1541   } else if (UseG1GC) {
1542     heap_alignment = G1CollectedHeap::conservative_max_heap_alignment();
1543   }
1544 #endif // INCLUDE_ALL_GCS
1545   _conservative_max_heap_alignment = MAX4(heap_alignment,
1546                                           (size_t)os::vm_allocation_granularity(),
1547                                           os::max_page_size(),
1548                                           CollectorPolicy::compute_heap_alignment());
1549 }
1550 
1551 void Arguments::select_gc_ergonomically() {
1552   if (os::is_server_class_machine()) {
1553     if (should_auto_select_low_pause_collector()) {
1554       FLAG_SET_ERGO(bool, UseConcMarkSweepGC, true);
1555     } else {
1556       FLAG_SET_ERGO(bool, UseParallelGC, true);
1557     }
1558   } else {
1559     FLAG_SET_ERGO(bool, UseSerialGC, true);
1560   }
1561 }
1562 
1563 void Arguments::select_gc() {
1564   if (!gc_selected()) {
1565     select_gc_ergonomically();
1566     guarantee(gc_selected(), "No GC selected");
1567   }
1568 }
1569 
1570 void Arguments::set_ergonomics_flags() {
1571   select_gc();
1572 
1573 #ifdef COMPILER2
1574   // Shared spaces work fine with other GCs but causes bytecode rewriting
1575   // to be disabled, which hurts interpreter performance and decreases
1576   // server performance.  When -server is specified, keep the default off
1577   // unless it is asked for.  Future work: either add bytecode rewriting
1578   // at link time, or rewrite bytecodes in non-shared methods.
1579   if (!DumpSharedSpaces && !RequireSharedSpaces &&
1580       (FLAG_IS_DEFAULT(UseSharedSpaces) || !UseSharedSpaces)) {
1581     no_shared_spaces("COMPILER2 default: -Xshare:auto | off, have to manually setup to on.");
1582   }
1583 #endif
1584 
1585   set_conservative_max_heap_alignment();
1586 


< prev index next >