1555
1556 return result;
1557 }
1558
1559 jint G1CollectedHeap::initialize_concurrent_refinement() {
1560 jint ecode = JNI_OK;
1561 _cr = G1ConcurrentRefine::create(&ecode);
1562 return ecode;
1563 }
1564
1565 jint G1CollectedHeap::initialize_young_gen_sampling_thread() {
1566 _young_gen_sampling_thread = new G1YoungRemSetSamplingThread();
1567 if (_young_gen_sampling_thread->osthread() == NULL) {
1568 vm_shutdown_during_initialization("Could not create G1YoungRemSetSamplingThread");
1569 return JNI_ENOMEM;
1570 }
1571 return JNI_OK;
1572 }
1573
1574 jint G1CollectedHeap::initialize() {
1575 CollectedHeap::pre_initialize();
1576 os::enable_vtime();
1577
1578 // Necessary to satisfy locking discipline assertions.
1579
1580 MutexLocker x(Heap_lock);
1581
1582 // While there are no constraints in the GC code that HeapWordSize
1583 // be any particular value, there are multiple other areas in the
1584 // system which believe this to be true (e.g. oop->object_size in some
1585 // cases incorrectly returns the size in wordSize units rather than
1586 // HeapWordSize).
1587 guarantee(HeapWordSize == wordSize, "HeapWordSize must equal wordSize");
1588
1589 size_t init_byte_size = collector_policy()->initial_heap_byte_size();
1590 size_t max_byte_size = collector_policy()->max_heap_byte_size();
1591 size_t heap_alignment = collector_policy()->heap_alignment();
1592
1593 // Ensure that the sizes are properly aligned.
1594 Universe::check_alignment(init_byte_size, HeapRegion::GrainBytes, "g1 heap");
|
1555
1556 return result;
1557 }
1558
1559 jint G1CollectedHeap::initialize_concurrent_refinement() {
1560 jint ecode = JNI_OK;
1561 _cr = G1ConcurrentRefine::create(&ecode);
1562 return ecode;
1563 }
1564
1565 jint G1CollectedHeap::initialize_young_gen_sampling_thread() {
1566 _young_gen_sampling_thread = new G1YoungRemSetSamplingThread();
1567 if (_young_gen_sampling_thread->osthread() == NULL) {
1568 vm_shutdown_during_initialization("Could not create G1YoungRemSetSamplingThread");
1569 return JNI_ENOMEM;
1570 }
1571 return JNI_OK;
1572 }
1573
1574 jint G1CollectedHeap::initialize() {
1575 os::enable_vtime();
1576
1577 // Necessary to satisfy locking discipline assertions.
1578
1579 MutexLocker x(Heap_lock);
1580
1581 // While there are no constraints in the GC code that HeapWordSize
1582 // be any particular value, there are multiple other areas in the
1583 // system which believe this to be true (e.g. oop->object_size in some
1584 // cases incorrectly returns the size in wordSize units rather than
1585 // HeapWordSize).
1586 guarantee(HeapWordSize == wordSize, "HeapWordSize must equal wordSize");
1587
1588 size_t init_byte_size = collector_policy()->initial_heap_byte_size();
1589 size_t max_byte_size = collector_policy()->max_heap_byte_size();
1590 size_t heap_alignment = collector_policy()->heap_alignment();
1591
1592 // Ensure that the sizes are properly aligned.
1593 Universe::check_alignment(init_byte_size, HeapRegion::GrainBytes, "g1 heap");
|