< 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

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

 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

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


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 }
< prev index next >