< prev index next >

src/hotspot/share/gc/g1/g1Arguments.cpp

Print this page

 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/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
 56   // size, but the heap size should be aligned with the region size. To get

226 #ifdef COMPILER2
227   // Enable loop strip mining to offer better pause time guarantees
228   if (FLAG_IS_DEFAULT(UseCountedLoopSafepoints)) {
229     FLAG_SET_DEFAULT(UseCountedLoopSafepoints, true);
230     if (FLAG_IS_DEFAULT(LoopStripMiningIter)) {
231       FLAG_SET_DEFAULT(LoopStripMiningIter, 1000);
232     }
233   }
234 #endif
235 
236   initialize_mark_stack_size();
237   initialize_verification_types();
238 
239   // Verify that the maximum parallelism isn't too high to eventually overflow
240   // the refcount in G1CardSetContainer.
241   uint max_parallel_refinement_threads = G1ConcRefinementThreads + G1DirtyCardQueueSet::num_par_ids();
242   uint const divisor = 3;  // Safe divisor; we increment by 2 for each claim, but there is a small initial value.
243   if (max_parallel_refinement_threads > UINT_MAX / divisor) {
244     vm_exit_during_initialization("Too large parallelism for remembered sets.");
245   }
246 
247   FullGCForwarding::initialize_flags(heap_reserved_size_bytes());
248 }
249 
250 CollectedHeap* G1Arguments::create_heap() {
251   return new G1CollectedHeap();
252 }
253 
254 size_t G1Arguments::heap_reserved_size_bytes() {
255   return MaxHeapSize;
256 }

 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/globals.hpp"
 39 #include "runtime/globals_extension.hpp"
 40 #include "runtime/java.hpp"
 41 
 42 static size_t calculate_heap_alignment(size_t space_alignment) {
 43   size_t card_table_alignment = CardTable::ct_max_alignment_constraint();
 44   size_t page_size = UseLargePages ? os::large_page_size() : os::vm_page_size();
 45   return MAX3(card_table_alignment, space_alignment, page_size);
 46 }
 47 
 48 void G1Arguments::initialize_alignments() {
 49   // Initialize card size before initializing alignments
 50   CardTable::initialize_card_size();
 51 
 52   // Set up the region size and associated fields.
 53   //
 54   // There is a circular dependency here. We base the region size on the heap
 55   // size, but the heap size should be aligned with the region size. To get

225 #ifdef COMPILER2
226   // Enable loop strip mining to offer better pause time guarantees
227   if (FLAG_IS_DEFAULT(UseCountedLoopSafepoints)) {
228     FLAG_SET_DEFAULT(UseCountedLoopSafepoints, true);
229     if (FLAG_IS_DEFAULT(LoopStripMiningIter)) {
230       FLAG_SET_DEFAULT(LoopStripMiningIter, 1000);
231     }
232   }
233 #endif
234 
235   initialize_mark_stack_size();
236   initialize_verification_types();
237 
238   // Verify that the maximum parallelism isn't too high to eventually overflow
239   // the refcount in G1CardSetContainer.
240   uint max_parallel_refinement_threads = G1ConcRefinementThreads + G1DirtyCardQueueSet::num_par_ids();
241   uint const divisor = 3;  // Safe divisor; we increment by 2 for each claim, but there is a small initial value.
242   if (max_parallel_refinement_threads > UINT_MAX / divisor) {
243     vm_exit_during_initialization("Too large parallelism for remembered sets.");
244   }


245 }
246 
247 CollectedHeap* G1Arguments::create_heap() {
248   return new G1CollectedHeap();
249 }
250 
251 size_t G1Arguments::heap_reserved_size_bytes() {
252   return MaxHeapSize;
253 }
< prev index next >