1763 // below will make sure of that and do any remaining clean up.
1764 _allocator->abandon_gc_alloc_regions();
1765
1766 // Instead of tearing down / rebuilding the free lists here, we
1767 // could instead use the remove_all_pending() method on free_list to
1768 // remove only the ones that we need to remove.
1769 tear_down_region_sets(true /* free_list_only */);
1770 shrink_helper(shrink_bytes);
1771 rebuild_region_sets(true /* free_list_only */);
1772
1773 _hrm.verify_optional();
1774 verify_region_sets_optional();
1775 }
1776
1777 // Public methods.
1778
1779 G1CollectedHeap::G1CollectedHeap(G1CollectorPolicy* policy_) :
1780 CollectedHeap(),
1781 _g1_policy(policy_),
1782 _dirty_card_queue_set(false),
1783 _into_cset_dirty_card_queue_set(false),
1784 _is_alive_closure_cm(this),
1785 _is_alive_closure_stw(this),
1786 _ref_processor_cm(NULL),
1787 _ref_processor_stw(NULL),
1788 _bot_shared(NULL),
1789 _cg1r(NULL),
1790 _g1mm(NULL),
1791 _refine_cte_cl(NULL),
1792 _secondary_free_list("Secondary Free List", new SecondaryFreeRegionListMtSafeChecker()),
1793 _old_set("Old Set", false /* humongous */, new OldRegionSetMtSafeChecker()),
1794 _humongous_set("Master Humongous Set", true /* humongous */, new HumongousRegionSetMtSafeChecker()),
1795 _humongous_reclaim_candidates(),
1796 _has_humongous_reclaim_candidates(false),
1797 _archive_allocator(NULL),
1798 _free_regions_coming(false),
1799 _young_list(new YoungList(this)),
1800 _gc_time_stamp(0),
1801 _summary_bytes_used(0),
1802 _survivor_evac_stats(YoungPLABSize, PLABWeight),
1803 _old_evac_stats(OldPLABSize, PLABWeight),
2027
2028 JavaThread::satb_mark_queue_set().initialize(SATB_Q_CBL_mon,
2029 SATB_Q_FL_lock,
2030 G1SATBProcessCompletedThreshold,
2031 Shared_SATB_Q_lock);
2032
2033 JavaThread::dirty_card_queue_set().initialize(_refine_cte_cl,
2034 DirtyCardQ_CBL_mon,
2035 DirtyCardQ_FL_lock,
2036 concurrent_g1_refine()->yellow_zone(),
2037 concurrent_g1_refine()->red_zone(),
2038 Shared_DirtyCardQ_lock);
2039
2040 dirty_card_queue_set().initialize(NULL, // Should never be called by the Java code
2041 DirtyCardQ_CBL_mon,
2042 DirtyCardQ_FL_lock,
2043 -1, // never trigger processing
2044 -1, // no limit on length
2045 Shared_DirtyCardQ_lock,
2046 &JavaThread::dirty_card_queue_set());
2047
2048 // Initialize the card queue set used to hold cards containing
2049 // references into the collection set.
2050 _into_cset_dirty_card_queue_set.initialize(NULL, // Should never be called by the Java code
2051 DirtyCardQ_CBL_mon,
2052 DirtyCardQ_FL_lock,
2053 -1, // never trigger processing
2054 -1, // no limit on length
2055 Shared_DirtyCardQ_lock,
2056 &JavaThread::dirty_card_queue_set());
2057
2058 // Here we allocate the dummy HeapRegion that is required by the
2059 // G1AllocRegion class.
2060 HeapRegion* dummy_region = _hrm.get_dummy_region();
2061
2062 // We'll re-use the same region whether the alloc region will
2063 // require BOT updates or not and, if it doesn't, then a non-young
2064 // region will complain that it cannot support allocations without
2065 // BOT updates. So we'll tag the dummy region as eden to avoid that.
2066 dummy_region->set_eden();
2067 // Make sure it's full.
2068 dummy_region->set_top(dummy_region->end());
2069 G1AllocRegion::setup(this, dummy_region);
2070
2071 _allocator->init_mutator_alloc_region();
2072
2073 // Do create of the monitoring and management support so that
2074 // values in the heap have been properly initialized.
2075 _g1mm = new G1MonitoringSupport(this);
2076
|
1763 // below will make sure of that and do any remaining clean up.
1764 _allocator->abandon_gc_alloc_regions();
1765
1766 // Instead of tearing down / rebuilding the free lists here, we
1767 // could instead use the remove_all_pending() method on free_list to
1768 // remove only the ones that we need to remove.
1769 tear_down_region_sets(true /* free_list_only */);
1770 shrink_helper(shrink_bytes);
1771 rebuild_region_sets(true /* free_list_only */);
1772
1773 _hrm.verify_optional();
1774 verify_region_sets_optional();
1775 }
1776
1777 // Public methods.
1778
1779 G1CollectedHeap::G1CollectedHeap(G1CollectorPolicy* policy_) :
1780 CollectedHeap(),
1781 _g1_policy(policy_),
1782 _dirty_card_queue_set(false),
1783 _is_alive_closure_cm(this),
1784 _is_alive_closure_stw(this),
1785 _ref_processor_cm(NULL),
1786 _ref_processor_stw(NULL),
1787 _bot_shared(NULL),
1788 _cg1r(NULL),
1789 _g1mm(NULL),
1790 _refine_cte_cl(NULL),
1791 _secondary_free_list("Secondary Free List", new SecondaryFreeRegionListMtSafeChecker()),
1792 _old_set("Old Set", false /* humongous */, new OldRegionSetMtSafeChecker()),
1793 _humongous_set("Master Humongous Set", true /* humongous */, new HumongousRegionSetMtSafeChecker()),
1794 _humongous_reclaim_candidates(),
1795 _has_humongous_reclaim_candidates(false),
1796 _archive_allocator(NULL),
1797 _free_regions_coming(false),
1798 _young_list(new YoungList(this)),
1799 _gc_time_stamp(0),
1800 _summary_bytes_used(0),
1801 _survivor_evac_stats(YoungPLABSize, PLABWeight),
1802 _old_evac_stats(OldPLABSize, PLABWeight),
2026
2027 JavaThread::satb_mark_queue_set().initialize(SATB_Q_CBL_mon,
2028 SATB_Q_FL_lock,
2029 G1SATBProcessCompletedThreshold,
2030 Shared_SATB_Q_lock);
2031
2032 JavaThread::dirty_card_queue_set().initialize(_refine_cte_cl,
2033 DirtyCardQ_CBL_mon,
2034 DirtyCardQ_FL_lock,
2035 concurrent_g1_refine()->yellow_zone(),
2036 concurrent_g1_refine()->red_zone(),
2037 Shared_DirtyCardQ_lock);
2038
2039 dirty_card_queue_set().initialize(NULL, // Should never be called by the Java code
2040 DirtyCardQ_CBL_mon,
2041 DirtyCardQ_FL_lock,
2042 -1, // never trigger processing
2043 -1, // no limit on length
2044 Shared_DirtyCardQ_lock,
2045 &JavaThread::dirty_card_queue_set());
2046
2047 // Here we allocate the dummy HeapRegion that is required by the
2048 // G1AllocRegion class.
2049 HeapRegion* dummy_region = _hrm.get_dummy_region();
2050
2051 // We'll re-use the same region whether the alloc region will
2052 // require BOT updates or not and, if it doesn't, then a non-young
2053 // region will complain that it cannot support allocations without
2054 // BOT updates. So we'll tag the dummy region as eden to avoid that.
2055 dummy_region->set_eden();
2056 // Make sure it's full.
2057 dummy_region->set_top(dummy_region->end());
2058 G1AllocRegion::setup(this, dummy_region);
2059
2060 _allocator->init_mutator_alloc_region();
2061
2062 // Do create of the monitoring and management support so that
2063 // values in the heap have been properly initialized.
2064 _g1mm = new G1MonitoringSupport(this);
2065
|