< prev index next >

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

Print this page
rev 52909 : imported patch delay_g1


1512   _cm(NULL),
1513   _cm_thread(NULL),
1514   _cr(NULL),
1515   _task_queues(NULL),
1516   _evacuation_failed(false),
1517   _evacuation_failed_info_array(NULL),
1518   _preserved_marks_set(true /* in_c_heap */),
1519 #ifndef PRODUCT
1520   _evacuation_failure_alot_for_current_gc(false),
1521   _evacuation_failure_alot_gc_number(0),
1522   _evacuation_failure_alot_count(0),
1523 #endif
1524   _ref_processor_stw(NULL),
1525   _is_alive_closure_stw(this),
1526   _is_subject_to_discovery_stw(this),
1527   _ref_processor_cm(NULL),
1528   _is_alive_closure_cm(this),
1529   _is_subject_to_discovery_cm(this),
1530   _in_cset_fast_test() {
1531 
1532   _workers = new WorkGang("GC Thread", ParallelGCThreads,
1533                           true /* are_GC_task_threads */,
1534                           false /* are_ConcurrentGC_threads */);
1535   _workers->initialize_workers();
1536   _verifier = new G1HeapVerifier(this);
1537 
1538   _allocator = new G1Allocator(this);
1539 
1540   _heap_sizing_policy = G1HeapSizingPolicy::create(this, _g1_policy->analytics());
1541 
1542   _humongous_object_threshold_in_words = humongous_threshold_for(HeapRegion::GrainWords);
1543 
1544   // Override the default _filler_array_max_size so that no humongous filler
1545   // objects are created.
1546   _filler_array_max_size = _humongous_object_threshold_in_words;
1547 
1548   uint n_queues = ParallelGCThreads;
1549   _task_queues = new RefToScanQueueSet(n_queues);
1550 
1551   _evacuation_failed_info_array = NEW_C_HEAP_ARRAY(EvacuationFailedInfo, n_queues, mtGC);
1552 
1553   for (uint i = 0; i < n_queues; i++) {
1554     RefToScanQueue* q = new RefToScanQueue();
1555     q->initialize();


1747   _g1_rem_set = new G1RemSet(this, _card_table, _hot_card_cache);
1748   _g1_rem_set->initialize(max_capacity(), max_regions());
1749 
1750   size_t max_cards_per_region = ((size_t)1 << (sizeof(CardIdx_t)*BitsPerByte-1)) - 1;
1751   guarantee(HeapRegion::CardsPerRegion > 0, "make sure it's initialized");
1752   guarantee(HeapRegion::CardsPerRegion < max_cards_per_region,
1753             "too many cards per region");
1754 
1755   FreeRegionList::set_unrealistically_long_length(max_regions() + 1);
1756 
1757   _bot = new G1BlockOffsetTable(reserved_region(), bot_storage);
1758 
1759   {
1760     HeapWord* start = _hrm.reserved().start();
1761     HeapWord* end = _hrm.reserved().end();
1762     size_t granularity = HeapRegion::GrainBytes;
1763 
1764     _in_cset_fast_test.initialize(start, end, granularity);
1765     _humongous_reclaim_candidates.initialize(start, end, granularity);
1766   }








1767 
1768   // Create the G1ConcurrentMark data structure and thread.
1769   // (Must do this late, so that "max_regions" is defined.)
1770   _cm = new G1ConcurrentMark(this, prev_bitmap_storage, next_bitmap_storage);
1771   if (_cm == NULL || !_cm->completed_initialization()) {
1772     vm_shutdown_during_initialization("Could not create/initialize G1ConcurrentMark");
1773     return JNI_ENOMEM;
1774   }
1775   _cm_thread = _cm->cm_thread();
1776 
1777   // Now expand into the initial heap size.
1778   if (!expand(init_byte_size, _workers)) {
1779     vm_shutdown_during_initialization("Failed to allocate initial heap.");
1780     return JNI_ENOMEM;
1781   }
1782 
1783   // Perform any initialization actions delegated to the policy.
1784   g1_policy()->init(this, &_collection_set);
1785 
1786   jint ecode = initialize_concurrent_refinement();




1512   _cm(NULL),
1513   _cm_thread(NULL),
1514   _cr(NULL),
1515   _task_queues(NULL),
1516   _evacuation_failed(false),
1517   _evacuation_failed_info_array(NULL),
1518   _preserved_marks_set(true /* in_c_heap */),
1519 #ifndef PRODUCT
1520   _evacuation_failure_alot_for_current_gc(false),
1521   _evacuation_failure_alot_gc_number(0),
1522   _evacuation_failure_alot_count(0),
1523 #endif
1524   _ref_processor_stw(NULL),
1525   _is_alive_closure_stw(this),
1526   _is_subject_to_discovery_stw(this),
1527   _ref_processor_cm(NULL),
1528   _is_alive_closure_cm(this),
1529   _is_subject_to_discovery_cm(this),
1530   _in_cset_fast_test() {
1531 




1532   _verifier = new G1HeapVerifier(this);
1533 
1534   _allocator = new G1Allocator(this);
1535 
1536   _heap_sizing_policy = G1HeapSizingPolicy::create(this, _g1_policy->analytics());
1537 
1538   _humongous_object_threshold_in_words = humongous_threshold_for(HeapRegion::GrainWords);
1539 
1540   // Override the default _filler_array_max_size so that no humongous filler
1541   // objects are created.
1542   _filler_array_max_size = _humongous_object_threshold_in_words;
1543 
1544   uint n_queues = ParallelGCThreads;
1545   _task_queues = new RefToScanQueueSet(n_queues);
1546 
1547   _evacuation_failed_info_array = NEW_C_HEAP_ARRAY(EvacuationFailedInfo, n_queues, mtGC);
1548 
1549   for (uint i = 0; i < n_queues; i++) {
1550     RefToScanQueue* q = new RefToScanQueue();
1551     q->initialize();


1743   _g1_rem_set = new G1RemSet(this, _card_table, _hot_card_cache);
1744   _g1_rem_set->initialize(max_capacity(), max_regions());
1745 
1746   size_t max_cards_per_region = ((size_t)1 << (sizeof(CardIdx_t)*BitsPerByte-1)) - 1;
1747   guarantee(HeapRegion::CardsPerRegion > 0, "make sure it's initialized");
1748   guarantee(HeapRegion::CardsPerRegion < max_cards_per_region,
1749             "too many cards per region");
1750 
1751   FreeRegionList::set_unrealistically_long_length(max_regions() + 1);
1752 
1753   _bot = new G1BlockOffsetTable(reserved_region(), bot_storage);
1754 
1755   {
1756     HeapWord* start = _hrm.reserved().start();
1757     HeapWord* end = _hrm.reserved().end();
1758     size_t granularity = HeapRegion::GrainBytes;
1759 
1760     _in_cset_fast_test.initialize(start, end, granularity);
1761     _humongous_reclaim_candidates.initialize(start, end, granularity);
1762   }
1763 
1764   _workers = new WorkGang("GC Thread", ParallelGCThreads,
1765                           true /* are_GC_task_threads */,
1766                           false /* are_ConcurrentGC_threads */);
1767   if (_workers == NULL) {
1768     return JNI_ENOMEM;
1769   }
1770   _workers->initialize_workers();
1771 
1772   // Create the G1ConcurrentMark data structure and thread.
1773   // (Must do this late, so that "max_regions" is defined.)
1774   _cm = new G1ConcurrentMark(this, prev_bitmap_storage, next_bitmap_storage);
1775   if (_cm == NULL || !_cm->completed_initialization()) {
1776     vm_shutdown_during_initialization("Could not create/initialize G1ConcurrentMark");
1777     return JNI_ENOMEM;
1778   }
1779   _cm_thread = _cm->cm_thread();
1780 
1781   // Now expand into the initial heap size.
1782   if (!expand(init_byte_size, _workers)) {
1783     vm_shutdown_during_initialization("Failed to allocate initial heap.");
1784     return JNI_ENOMEM;
1785   }
1786 
1787   // Perform any initialization actions delegated to the policy.
1788   g1_policy()->init(this, &_collection_set);
1789 
1790   jint ecode = initialize_concurrent_refinement();


< prev index next >