mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-26 14:24:46 +02:00
8208669: GC changes to allow enabling -Wreorder
Reviewed-by: kbarrett
This commit is contained in:
parent
a00eff193f
commit
d702d5f8d2
80 changed files with 371 additions and 294 deletions
|
@ -320,7 +320,12 @@ void CompactibleFreeListSpace::set_cms_values() {
|
|||
|
||||
// Constructor
|
||||
CompactibleFreeListSpace::CompactibleFreeListSpace(BlockOffsetSharedArray* bs, MemRegion mr) :
|
||||
_rescan_task_size(CardTable::card_size_in_words * BitsPerWord *
|
||||
CMSRescanMultiple),
|
||||
_marking_task_size(CardTable::card_size_in_words * BitsPerWord *
|
||||
CMSConcMarkMultiple),
|
||||
_bt(bs, mr),
|
||||
_collector(NULL),
|
||||
// free list locks are in the range of values taken by _lockRank
|
||||
// This range currently is [_leaf+2, _leaf+3]
|
||||
// Note: this requires that CFLspace c'tors
|
||||
|
@ -328,15 +333,10 @@ CompactibleFreeListSpace::CompactibleFreeListSpace(BlockOffsetSharedArray* bs, M
|
|||
// are acquired in the program text. This is true today.
|
||||
_freelistLock(_lockRank--, "CompactibleFreeListSpace._lock", true,
|
||||
Monitor::_safepoint_check_sometimes),
|
||||
_preconsumptionDirtyCardClosure(NULL),
|
||||
_parDictionaryAllocLock(Mutex::leaf - 1, // == rank(ExpandHeap_lock) - 1
|
||||
"CompactibleFreeListSpace._dict_par_lock", true,
|
||||
Monitor::_safepoint_check_never),
|
||||
_rescan_task_size(CardTable::card_size_in_words * BitsPerWord *
|
||||
CMSRescanMultiple),
|
||||
_marking_task_size(CardTable::card_size_in_words * BitsPerWord *
|
||||
CMSConcMarkMultiple),
|
||||
_collector(NULL),
|
||||
_preconsumptionDirtyCardClosure(NULL)
|
||||
Monitor::_safepoint_check_never)
|
||||
{
|
||||
assert(sizeof(FreeChunk) / BytesPerWord <= MinChunkSize,
|
||||
"FreeChunk is larger than expected");
|
||||
|
|
|
@ -449,57 +449,57 @@ bool CMSCollector::_foregroundGCShouldWait = false;
|
|||
CMSCollector::CMSCollector(ConcurrentMarkSweepGeneration* cmsGen,
|
||||
CardTableRS* ct,
|
||||
ConcurrentMarkSweepPolicy* cp):
|
||||
_overflow_list(NULL),
|
||||
_conc_workers(NULL), // may be set later
|
||||
_completed_initialization(false),
|
||||
_collection_count_start(0),
|
||||
_should_unload_classes(CMSClassUnloadingEnabled),
|
||||
_concurrent_cycles_since_last_unload(0),
|
||||
_roots_scanning_options(GenCollectedHeap::SO_None),
|
||||
_verification_mark_bm(0, Mutex::leaf + 1, "CMS_verification_mark_bm_lock"),
|
||||
_verifying(false),
|
||||
_collector_policy(cp),
|
||||
_inter_sweep_estimate(CMS_SweepWeight, CMS_SweepPadding),
|
||||
_intra_sweep_estimate(CMS_SweepWeight, CMS_SweepPadding),
|
||||
_gc_tracer_cm(new (ResourceObj::C_HEAP, mtGC) CMSTracer()),
|
||||
_gc_timer_cm(new (ResourceObj::C_HEAP, mtGC) ConcurrentGCTimer()),
|
||||
_cms_start_registered(false),
|
||||
_cmsGen(cmsGen),
|
||||
// Adjust span to cover old (cms) gen
|
||||
_span(cmsGen->reserved()),
|
||||
_ct(ct),
|
||||
_span_based_discoverer(_span),
|
||||
_ref_processor(NULL), // will be set later
|
||||
_conc_workers(NULL), // may be set later
|
||||
_abort_preclean(false),
|
||||
_start_sampling(false),
|
||||
_between_prologue_and_epilogue(false),
|
||||
_markBitMap(0, Mutex::leaf + 1, "CMS_markBitMap_lock"),
|
||||
_modUnionTable((CardTable::card_shift - LogHeapWordSize),
|
||||
-1 /* lock-free */, "No_lock" /* dummy */),
|
||||
_modUnionClosurePar(&_modUnionTable),
|
||||
// Construct the is_alive_closure with _span & markBitMap
|
||||
_is_alive_closure(_span, &_markBitMap),
|
||||
_restart_addr(NULL),
|
||||
_overflow_list(NULL),
|
||||
_stats(cmsGen),
|
||||
_eden_chunk_lock(new Mutex(Mutex::leaf + 1, "CMS_eden_chunk_lock", true,
|
||||
//verify that this lock should be acquired with safepoint check.
|
||||
Monitor::_safepoint_check_sometimes)),
|
||||
_eden_chunk_array(NULL), // may be set in ctor body
|
||||
_eden_chunk_capacity(0), // -- ditto --
|
||||
_eden_chunk_index(0), // -- ditto --
|
||||
_survivor_plab_array(NULL), // -- ditto --
|
||||
_survivor_chunk_array(NULL), // -- ditto --
|
||||
_survivor_chunk_capacity(0), // -- ditto --
|
||||
_survivor_chunk_index(0), // -- ditto --
|
||||
_ser_pmc_preclean_ovflw(0),
|
||||
_ser_kac_preclean_ovflw(0),
|
||||
_ser_pmc_remark_ovflw(0),
|
||||
_par_pmc_remark_ovflw(0),
|
||||
_ser_kac_preclean_ovflw(0),
|
||||
_ser_kac_ovflw(0),
|
||||
_par_kac_ovflw(0),
|
||||
#ifndef PRODUCT
|
||||
_num_par_pushes(0),
|
||||
#endif
|
||||
_collection_count_start(0),
|
||||
_verifying(false),
|
||||
_verification_mark_bm(0, Mutex::leaf + 1, "CMS_verification_mark_bm_lock"),
|
||||
_completed_initialization(false),
|
||||
_collector_policy(cp),
|
||||
_should_unload_classes(CMSClassUnloadingEnabled),
|
||||
_concurrent_cycles_since_last_unload(0),
|
||||
_roots_scanning_options(GenCollectedHeap::SO_None),
|
||||
_inter_sweep_estimate(CMS_SweepWeight, CMS_SweepPadding),
|
||||
_intra_sweep_estimate(CMS_SweepWeight, CMS_SweepPadding),
|
||||
_gc_tracer_cm(new (ResourceObj::C_HEAP, mtGC) CMSTracer()),
|
||||
_gc_timer_cm(new (ResourceObj::C_HEAP, mtGC) ConcurrentGCTimer()),
|
||||
_cms_start_registered(false)
|
||||
_span_based_discoverer(_span),
|
||||
_ref_processor(NULL), // will be set later
|
||||
// Construct the is_alive_closure with _span & markBitMap
|
||||
_is_alive_closure(_span, &_markBitMap),
|
||||
_modUnionClosurePar(&_modUnionTable),
|
||||
_between_prologue_and_epilogue(false),
|
||||
_abort_preclean(false),
|
||||
_start_sampling(false),
|
||||
_stats(cmsGen),
|
||||
_eden_chunk_lock(new Mutex(Mutex::leaf + 1, "CMS_eden_chunk_lock", true,
|
||||
//verify that this lock should be acquired with safepoint check.
|
||||
Monitor::_safepoint_check_sometimes)),
|
||||
_eden_chunk_array(NULL), // may be set in ctor body
|
||||
_eden_chunk_index(0), // -- ditto --
|
||||
_eden_chunk_capacity(0), // -- ditto --
|
||||
_survivor_chunk_array(NULL), // -- ditto --
|
||||
_survivor_chunk_index(0), // -- ditto --
|
||||
_survivor_chunk_capacity(0), // -- ditto --
|
||||
_survivor_plab_array(NULL) // -- ditto --
|
||||
{
|
||||
// Now expand the span and allocate the collection support structures
|
||||
// (MUT, marking bit map etc.) to cover both generations subject to
|
||||
|
@ -3037,11 +3037,12 @@ class CMSConcMarkingTask: public YieldingFlexibleGangTask {
|
|||
OopTaskQueueSet* task_queues):
|
||||
YieldingFlexibleGangTask("Concurrent marking done multi-threaded"),
|
||||
_collector(collector),
|
||||
_n_workers(0),
|
||||
_result(true),
|
||||
_cms_space(cms_space),
|
||||
_n_workers(0), _result(true),
|
||||
_bit_map_lock(collector->bitMapLock()),
|
||||
_task_queues(task_queues),
|
||||
_term(_n_workers, task_queues, _collector),
|
||||
_bit_map_lock(collector->bitMapLock())
|
||||
_term(_n_workers, task_queues, _collector)
|
||||
{
|
||||
_requested_size = _n_workers;
|
||||
_term.set_task(this);
|
||||
|
@ -3320,9 +3321,9 @@ class ParConcMarkingClosure: public MetadataVisitingOopIterateClosure {
|
|||
_collector(collector),
|
||||
_task(task),
|
||||
_span(collector->_span),
|
||||
_work_queue(work_queue),
|
||||
_bit_map(bit_map),
|
||||
_overflow_stack(overflow_stack)
|
||||
_overflow_stack(overflow_stack),
|
||||
_work_queue(work_queue)
|
||||
{ }
|
||||
virtual void do_oop(oop* p);
|
||||
virtual void do_oop(narrowOop* p);
|
||||
|
@ -5024,8 +5025,10 @@ public:
|
|||
AbstractGangTaskWOopQueues("Process referents by policy in parallel",
|
||||
task_queues,
|
||||
workers->active_workers()),
|
||||
_task(task),
|
||||
_collector(collector), _span(span), _mark_bit_map(mark_bit_map)
|
||||
_collector(collector),
|
||||
_mark_bit_map(mark_bit_map),
|
||||
_span(span),
|
||||
_task(task)
|
||||
{
|
||||
assert(_collector->_span.equals(_span) && !_span.is_empty(),
|
||||
"Inconsistency in _span");
|
||||
|
@ -5064,8 +5067,8 @@ void CMSRefProcTaskProxy::work(uint worker_id) {
|
|||
CMSParKeepAliveClosure::CMSParKeepAliveClosure(CMSCollector* collector,
|
||||
MemRegion span, CMSBitMap* bit_map, OopTaskQueue* work_queue):
|
||||
_span(span),
|
||||
_bit_map(bit_map),
|
||||
_work_queue(work_queue),
|
||||
_bit_map(bit_map),
|
||||
_mark_and_push(collector, span, bit_map, work_queue),
|
||||
_low_water_mark(MIN2((work_queue->max_elems()/4),
|
||||
((uint)CMSWorkQueueDrainThreshold * ParallelGCThreads)))
|
||||
|
@ -5602,8 +5605,8 @@ HeapWord* CMSCollector::next_card_start_after_block(HeapWord* addr) const {
|
|||
// bit vector itself. That is done by a separate call CMSBitMap::allocate()
|
||||
// further below.
|
||||
CMSBitMap::CMSBitMap(int shifter, int mutex_rank, const char* mutex_name):
|
||||
_bm(),
|
||||
_shifter(shifter),
|
||||
_bm(),
|
||||
_lock(mutex_rank >= 0 ? new Mutex(mutex_rank, mutex_name, true,
|
||||
Monitor::_safepoint_check_sometimes) : NULL)
|
||||
{
|
||||
|
@ -5852,15 +5855,15 @@ MarkRefsIntoAndScanClosure::MarkRefsIntoAndScanClosure(MemRegion span,
|
|||
CMSCollector* collector,
|
||||
bool should_yield,
|
||||
bool concurrent_precleaning):
|
||||
_collector(collector),
|
||||
_span(span),
|
||||
_bit_map(bit_map),
|
||||
_mark_stack(mark_stack),
|
||||
_pushAndMarkClosure(collector, span, rd, bit_map, mod_union_table,
|
||||
mark_stack, concurrent_precleaning),
|
||||
_collector(collector),
|
||||
_freelistLock(NULL),
|
||||
_yield(should_yield),
|
||||
_concurrent_precleaning(concurrent_precleaning),
|
||||
_freelistLock(NULL)
|
||||
_concurrent_precleaning(concurrent_precleaning)
|
||||
{
|
||||
// FIXME: Should initialize in base class constructor.
|
||||
assert(rd != NULL, "ref_discoverer shouldn't be NULL");
|
||||
|
@ -6957,10 +6960,10 @@ SweepClosure::SweepClosure(CMSCollector* collector,
|
|||
_limit(_sp->sweep_limit()),
|
||||
_freelistLock(_sp->freelistLock()),
|
||||
_bitMap(bitMap),
|
||||
_yield(should_yield),
|
||||
_inFreeRange(false), // No free range at beginning of sweep
|
||||
_freeRangeInFreeLists(false), // No free range at beginning of sweep
|
||||
_lastFreeRangeCoalesced(false),
|
||||
_yield(should_yield),
|
||||
_freeFinger(g->used_region().start())
|
||||
{
|
||||
NOT_PRODUCT(
|
||||
|
@ -7514,15 +7517,14 @@ bool CMSIsAliveClosure::do_object_b(oop obj) {
|
|||
(!_span.contains(addr) || _bit_map->isMarked(addr));
|
||||
}
|
||||
|
||||
|
||||
CMSKeepAliveClosure::CMSKeepAliveClosure( CMSCollector* collector,
|
||||
MemRegion span,
|
||||
CMSBitMap* bit_map, CMSMarkStack* mark_stack,
|
||||
bool cpc):
|
||||
_collector(collector),
|
||||
_span(span),
|
||||
_bit_map(bit_map),
|
||||
_mark_stack(mark_stack),
|
||||
_bit_map(bit_map),
|
||||
_concurrent_precleaning(cpc) {
|
||||
assert(!_span.is_empty(), "Empty span could spell trouble");
|
||||
}
|
||||
|
@ -7610,8 +7612,8 @@ CMSInnerParMarkAndPushClosure::CMSInnerParMarkAndPushClosure(
|
|||
OopTaskQueue* work_queue):
|
||||
_collector(collector),
|
||||
_span(span),
|
||||
_bit_map(bit_map),
|
||||
_work_queue(work_queue) { }
|
||||
_work_queue(work_queue),
|
||||
_bit_map(bit_map) { }
|
||||
|
||||
void CMSInnerParMarkAndPushClosure::do_oop(oop obj) {
|
||||
HeapWord* addr = (HeapWord*)obj;
|
||||
|
|
|
@ -1452,9 +1452,9 @@ class MarkFromDirtyCardsClosure: public MemRegionClosure {
|
|||
CMSMarkStack* mark_stack,
|
||||
MarkRefsIntoAndScanClosure* cl):
|
||||
_space(space),
|
||||
_num_dirty_cards(0),
|
||||
_scan_cl(collector, span, collector->ref_processor(), bit_map,
|
||||
mark_stack, cl) { }
|
||||
mark_stack, cl),
|
||||
_num_dirty_cards(0) { }
|
||||
|
||||
MarkFromDirtyCardsClosure(CMSCollector* collector,
|
||||
MemRegion span,
|
||||
|
@ -1463,9 +1463,9 @@ class MarkFromDirtyCardsClosure: public MemRegionClosure {
|
|||
OopTaskQueue* work_queue,
|
||||
ParMarkRefsIntoAndScanClosure* cl):
|
||||
_space(space),
|
||||
_num_dirty_cards(0),
|
||||
_scan_cl(collector, span, collector->ref_processor(), bit_map,
|
||||
work_queue, cl) { }
|
||||
work_queue, cl),
|
||||
_num_dirty_cards(0) { }
|
||||
|
||||
void do_MemRegion(MemRegion mr);
|
||||
void set_space(CompactibleFreeListSpace* space) { _space = space; }
|
||||
|
@ -1707,8 +1707,8 @@ class CMSDrainMarkingStackClosure: public VoidClosure {
|
|||
bool cpc):
|
||||
_collector(collector),
|
||||
_span(span),
|
||||
_bit_map(bit_map),
|
||||
_mark_stack(mark_stack),
|
||||
_bit_map(bit_map),
|
||||
_keep_alive(keep_alive),
|
||||
_concurrent_precleaning(cpc) {
|
||||
assert(_concurrent_precleaning == _keep_alive->concurrent_precleaning(),
|
||||
|
@ -1732,8 +1732,8 @@ class CMSParDrainMarkingStackClosure: public VoidClosure {
|
|||
OopTaskQueue* work_queue):
|
||||
_collector(collector),
|
||||
_span(span),
|
||||
_bit_map(bit_map),
|
||||
_work_queue(work_queue),
|
||||
_bit_map(bit_map),
|
||||
_mark_and_push(collector, span, bit_map, work_queue) { }
|
||||
|
||||
public:
|
||||
|
|
|
@ -75,27 +75,28 @@ ParScanThreadState::ParScanThreadState(Space* to_space_,
|
|||
PreservedMarks* preserved_marks_,
|
||||
size_t desired_plab_sz_,
|
||||
ParallelTaskTerminator& term_) :
|
||||
_to_space(to_space_),
|
||||
_old_gen(old_gen_),
|
||||
_young_gen(young_gen_),
|
||||
_thread_num(thread_num_),
|
||||
_work_queue(work_queue_set_->queue(thread_num_)),
|
||||
_to_space_full(false),
|
||||
_overflow_stack(overflow_stacks_ ? overflow_stacks_ + thread_num_ : NULL),
|
||||
_preserved_marks(preserved_marks_),
|
||||
_ageTable(false), // false ==> not the global age table, no perf data.
|
||||
_to_space_alloc_buffer(desired_plab_sz_),
|
||||
_to_space_closure(young_gen_, this),
|
||||
_old_gen_closure(young_gen_, this),
|
||||
_to_space_root_closure(young_gen_, this),
|
||||
_old_gen_root_closure(young_gen_, this),
|
||||
_older_gen_closure(young_gen_, this),
|
||||
_old_gen_root_closure(young_gen_, this),
|
||||
_evacuate_followers(this, &_to_space_closure, &_old_gen_closure,
|
||||
&_to_space_root_closure, young_gen_, &_old_gen_root_closure,
|
||||
work_queue_set_, &term_),
|
||||
_is_alive_closure(young_gen_),
|
||||
_scan_weak_ref_closure(young_gen_, this),
|
||||
_keep_alive_closure(&_scan_weak_ref_closure),
|
||||
_to_space(to_space_),
|
||||
_young_gen(young_gen_),
|
||||
_old_gen(old_gen_),
|
||||
_young_old_boundary(NULL),
|
||||
_thread_num(thread_num_),
|
||||
_ageTable(false), // false ==> not the global age table, no perf data.
|
||||
_to_space_full(false),
|
||||
_strong_roots_time(0.0),
|
||||
_term_time(0.0)
|
||||
{
|
||||
|
@ -344,9 +345,9 @@ ParScanThreadStateSet::ParScanThreadStateSet(int num_threads,
|
|||
PreservedMarksSet& preserved_marks_set,
|
||||
size_t desired_plab_sz,
|
||||
ParallelTaskTerminator& term)
|
||||
: _young_gen(young_gen),
|
||||
: _term(term),
|
||||
_young_gen(young_gen),
|
||||
_old_gen(old_gen),
|
||||
_term(term),
|
||||
_per_thread_states(NEW_RESOURCE_ARRAY(ParScanThreadState, num_threads)),
|
||||
_num_threads(num_threads)
|
||||
{
|
||||
|
@ -529,8 +530,8 @@ ParEvacuateFollowersClosure::ParEvacuateFollowersClosure(
|
|||
|
||||
_par_scan_state(par_scan_state_),
|
||||
_to_space_closure(to_space_closure_),
|
||||
_old_gen_closure(old_gen_closure_),
|
||||
_to_space_root_closure(to_space_root_closure_),
|
||||
_old_gen_closure(old_gen_closure_),
|
||||
_old_gen_root_closure(old_gen_root_closure_),
|
||||
_par_gen(par_gen_),
|
||||
_task_queues(task_queues_),
|
||||
|
@ -625,9 +626,9 @@ void ParNewGenTask::work(uint worker_id) {
|
|||
|
||||
ParNewGeneration::ParNewGeneration(ReservedSpace rs, size_t initial_byte_size)
|
||||
: DefNewGeneration(rs, initial_byte_size, "PCopy"),
|
||||
_plab_stats("Young", YoungPLABSize, PLABWeight),
|
||||
_overflow_list(NULL),
|
||||
_is_alive_closure(this),
|
||||
_plab_stats("Young", YoungPLABSize, PLABWeight)
|
||||
_is_alive_closure(this)
|
||||
{
|
||||
NOT_PRODUCT(_overflow_counter = ParGCWorkQueueOverflowInterval;)
|
||||
NOT_PRODUCT(_num_par_pushes = 0;)
|
||||
|
|
|
@ -27,11 +27,11 @@
|
|||
#include "gc/epsilon/epsilonMemoryPool.hpp"
|
||||
|
||||
EpsilonMemoryPool::EpsilonMemoryPool(EpsilonHeap* heap) :
|
||||
_heap(heap),
|
||||
CollectedMemoryPool("Epsilon Heap",
|
||||
heap->capacity(),
|
||||
heap->max_capacity(),
|
||||
false) {
|
||||
false),
|
||||
_heap(heap) {
|
||||
assert(UseEpsilonGC, "sanity");
|
||||
}
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@ class G1PreBarrierStub: public CodeStub {
|
|||
// addr (the address of the field to be read) must be a LIR_Address
|
||||
// pre_val (a temporary register) must be a register;
|
||||
G1PreBarrierStub(LIR_Opr addr, LIR_Opr pre_val, LIR_PatchCode patch_code, CodeEmitInfo* info) :
|
||||
_addr(addr), _pre_val(pre_val), _do_load(true),
|
||||
_do_load(true), _addr(addr), _pre_val(pre_val),
|
||||
_patch_code(patch_code), _info(info)
|
||||
{
|
||||
assert(_pre_val->is_register(), "should be temporary register");
|
||||
|
@ -52,7 +52,7 @@ class G1PreBarrierStub: public CodeStub {
|
|||
// Version that _does not_ generate load of the previous value; the
|
||||
// previous value is assumed to have already been loaded into pre_val.
|
||||
G1PreBarrierStub(LIR_Opr pre_val) :
|
||||
_addr(LIR_OprFact::illegalOpr), _pre_val(pre_val), _do_load(false),
|
||||
_do_load(false), _addr(LIR_OprFact::illegalOpr), _pre_val(pre_val),
|
||||
_patch_code(lir_patch_none), _info(NULL)
|
||||
{
|
||||
assert(_pre_val->is_register(), "should be a register");
|
||||
|
|
|
@ -251,10 +251,12 @@ void G1AllocRegion::trace(const char* str, size_t min_word_size, size_t desired_
|
|||
|
||||
G1AllocRegion::G1AllocRegion(const char* name,
|
||||
bool bot_updates)
|
||||
: _name(name), _bot_updates(bot_updates),
|
||||
_alloc_region(NULL), _count(0),
|
||||
_used_bytes_before(0) { }
|
||||
|
||||
: _alloc_region(NULL),
|
||||
_count(0),
|
||||
_used_bytes_before(0),
|
||||
_bot_updates(bot_updates),
|
||||
_name(name)
|
||||
{ }
|
||||
|
||||
HeapRegion* MutatorAllocRegion::allocate_new_region(size_t word_size,
|
||||
bool force) {
|
||||
|
|
|
@ -37,9 +37,10 @@ G1Allocator::G1Allocator(G1CollectedHeap* heap) :
|
|||
_g1h(heap),
|
||||
_survivor_is_full(false),
|
||||
_old_is_full(false),
|
||||
_retained_old_gc_alloc_region(NULL),
|
||||
_mutator_alloc_region(),
|
||||
_survivor_gc_alloc_region(heap->alloc_buffer_stats(InCSetState::Young)),
|
||||
_old_gc_alloc_region(heap->alloc_buffer_stats(InCSetState::Old)) {
|
||||
_old_gc_alloc_region(heap->alloc_buffer_stats(InCSetState::Old)),
|
||||
_retained_old_gc_alloc_region(NULL) {
|
||||
}
|
||||
|
||||
void G1Allocator::init_mutator_alloc_region() {
|
||||
|
|
|
@ -221,6 +221,7 @@ protected:
|
|||
|
||||
public:
|
||||
G1ArchiveAllocator(G1CollectedHeap* g1h, bool open) :
|
||||
_open(open),
|
||||
_g1h(g1h),
|
||||
_allocation_region(NULL),
|
||||
_allocated_regions((ResourceObj::set_allocation_type((address) &_allocated_regions,
|
||||
|
@ -229,8 +230,7 @@ public:
|
|||
_summary_bytes_used(0),
|
||||
_bottom(NULL),
|
||||
_top(NULL),
|
||||
_max(NULL),
|
||||
_open(open) { }
|
||||
_max(NULL) { }
|
||||
|
||||
virtual ~G1ArchiveAllocator() {
|
||||
assert(_allocation_region == NULL, "_allocation_region not NULL");
|
||||
|
|
|
@ -84,12 +84,12 @@ G1Analytics::G1Analytics(const G1Predictions* predictor) :
|
|||
_cost_per_entry_ms_seq(new TruncatedSeq(TruncatedSeqLength)),
|
||||
_mixed_cost_per_entry_ms_seq(new TruncatedSeq(TruncatedSeqLength)),
|
||||
_cost_per_byte_ms_seq(new TruncatedSeq(TruncatedSeqLength)),
|
||||
_cost_per_byte_ms_during_cm_seq(new TruncatedSeq(TruncatedSeqLength)),
|
||||
_constant_other_time_ms_seq(new TruncatedSeq(TruncatedSeqLength)),
|
||||
_young_other_cost_per_region_ms_seq(new TruncatedSeq(TruncatedSeqLength)),
|
||||
_non_young_other_cost_per_region_ms_seq(new TruncatedSeq(TruncatedSeqLength)),
|
||||
_pending_cards_seq(new TruncatedSeq(TruncatedSeqLength)),
|
||||
_rs_lengths_seq(new TruncatedSeq(TruncatedSeqLength)),
|
||||
_cost_per_byte_ms_during_cm_seq(new TruncatedSeq(TruncatedSeqLength)),
|
||||
_recent_prev_end_times_for_all_gcs_sec(new TruncatedSeq(NumPrevPausesForHeuristics)),
|
||||
_recent_avg_pause_time_ratio(0.0),
|
||||
_last_pause_time_ratio(0.0) {
|
||||
|
|
|
@ -75,12 +75,12 @@ void G1BlockOffsetTable::check_index(size_t index, const char* msg) const {
|
|||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
G1BlockOffsetTablePart::G1BlockOffsetTablePart(G1BlockOffsetTable* array, G1ContiguousSpace* gsp) :
|
||||
_bot(array),
|
||||
_space(gsp),
|
||||
_next_offset_threshold(NULL),
|
||||
_next_offset_index(0)
|
||||
_next_offset_index(0),
|
||||
DEBUG_ONLY(_object_can_span(false) COMMA)
|
||||
_bot(array),
|
||||
_space(gsp)
|
||||
{
|
||||
debug_only(_object_can_span = false;)
|
||||
}
|
||||
|
||||
// The arguments follow the normal convention of denoting
|
||||
|
|
|
@ -1407,52 +1407,70 @@ void G1CollectedHeap::shrink(size_t shrink_bytes) {
|
|||
_verifier->verify_region_sets_optional();
|
||||
}
|
||||
|
||||
// Public methods.
|
||||
|
||||
G1CollectedHeap::G1CollectedHeap(G1CollectorPolicy* collector_policy) :
|
||||
CollectedHeap(),
|
||||
_young_gen_sampling_thread(NULL),
|
||||
_workers(NULL),
|
||||
_collector_policy(collector_policy),
|
||||
_soft_ref_policy(),
|
||||
_card_table(NULL),
|
||||
_soft_ref_policy(),
|
||||
_memory_manager("G1 Young Generation", "end of minor GC"),
|
||||
_full_gc_memory_manager("G1 Old Generation", "end of major GC"),
|
||||
_eden_pool(NULL),
|
||||
_survivor_pool(NULL),
|
||||
_old_pool(NULL),
|
||||
_old_set("Old Set", false /* humongous */, new OldRegionSetMtSafeChecker()),
|
||||
_humongous_set("Master Humongous Set", true /* humongous */, new HumongousRegionSetMtSafeChecker()),
|
||||
_bot(NULL),
|
||||
_listener(),
|
||||
_hrm(),
|
||||
_allocator(NULL),
|
||||
_verifier(NULL),
|
||||
_summary_bytes_used(0),
|
||||
_archive_allocator(NULL),
|
||||
_survivor_evac_stats("Young", YoungPLABSize, PLABWeight),
|
||||
_old_evac_stats("Old", OldPLABSize, PLABWeight),
|
||||
_expand_heap_after_alloc_failure(true),
|
||||
_g1mm(NULL),
|
||||
_humongous_reclaim_candidates(),
|
||||
_has_humongous_reclaim_candidates(false),
|
||||
_hr_printer(),
|
||||
_collector_state(),
|
||||
_old_marking_cycles_started(0),
|
||||
_old_marking_cycles_completed(0),
|
||||
_eden(),
|
||||
_survivor(),
|
||||
_gc_timer_stw(new (ResourceObj::C_HEAP, mtGC) STWGCTimer()),
|
||||
_gc_tracer_stw(new (ResourceObj::C_HEAP, mtGC) G1NewTracer()),
|
||||
_g1_policy(new G1Policy(_gc_timer_stw)),
|
||||
_heap_sizing_policy(NULL),
|
||||
_collection_set(this, _g1_policy),
|
||||
_hot_card_cache(NULL),
|
||||
_g1_rem_set(NULL),
|
||||
_dirty_card_queue_set(false),
|
||||
_cm(NULL),
|
||||
_cm_thread(NULL),
|
||||
_cr(NULL),
|
||||
_task_queues(NULL),
|
||||
_evacuation_failed(false),
|
||||
_evacuation_failed_info_array(NULL),
|
||||
_preserved_marks_set(true /* in_c_heap */),
|
||||
#ifndef PRODUCT
|
||||
_evacuation_failure_alot_for_current_gc(false),
|
||||
_evacuation_failure_alot_gc_number(0),
|
||||
_evacuation_failure_alot_count(0),
|
||||
#endif
|
||||
_ref_processor_stw(NULL),
|
||||
_is_alive_closure_stw(this),
|
||||
_is_subject_to_discovery_stw(this),
|
||||
_ref_processor_cm(NULL),
|
||||
_is_alive_closure_cm(this),
|
||||
_is_subject_to_discovery_cm(this),
|
||||
_bot(NULL),
|
||||
_hot_card_cache(NULL),
|
||||
_g1_rem_set(NULL),
|
||||
_cr(NULL),
|
||||
_g1mm(NULL),
|
||||
_preserved_marks_set(true /* in_c_heap */),
|
||||
_old_set("Old Set", false /* humongous */, new OldRegionSetMtSafeChecker()),
|
||||
_humongous_set("Master Humongous Set", true /* humongous */, new HumongousRegionSetMtSafeChecker()),
|
||||
_humongous_reclaim_candidates(),
|
||||
_has_humongous_reclaim_candidates(false),
|
||||
_archive_allocator(NULL),
|
||||
_summary_bytes_used(0),
|
||||
_survivor_evac_stats("Young", YoungPLABSize, PLABWeight),
|
||||
_old_evac_stats("Old", OldPLABSize, PLABWeight),
|
||||
_expand_heap_after_alloc_failure(true),
|
||||
_old_marking_cycles_started(0),
|
||||
_old_marking_cycles_completed(0),
|
||||
_in_cset_fast_test() {
|
||||
|
||||
_workers = new WorkGang("GC Thread", ParallelGCThreads,
|
||||
/* are_GC_task_threads */true,
|
||||
/* are_ConcurrentGC_threads */false);
|
||||
true /* are_GC_task_threads */,
|
||||
false /* are_ConcurrentGC_threads */);
|
||||
_workers->initialize_workers();
|
||||
_verifier = new G1HeapVerifier(this);
|
||||
|
||||
|
@ -3576,10 +3594,10 @@ public:
|
|||
// The constructor is run in the VMThread.
|
||||
G1ParallelCleaningTask(BoolObjectClosure* is_alive, uint num_workers, bool unloading_occurred) :
|
||||
AbstractGangTask("Parallel Cleaning"),
|
||||
_unloading_occurred(unloading_occurred),
|
||||
_string_symbol_task(is_alive, true, true, G1StringDedup::is_enabled()),
|
||||
_code_cache_task(num_workers, is_alive, unloading_occurred),
|
||||
_klass_cleaning_task(),
|
||||
_unloading_occurred(unloading_occurred),
|
||||
_resolved_method_cleaning_task() {
|
||||
}
|
||||
|
||||
|
@ -4325,11 +4343,11 @@ private:
|
|||
public:
|
||||
G1FreeCollectionSetTask(G1CollectionSet* collection_set, EvacuationInfo* evacuation_info, const size_t* surviving_young_words) :
|
||||
AbstractGangTask("G1 Free Collection Set"),
|
||||
_cl(evacuation_info, surviving_young_words),
|
||||
_collection_set(collection_set),
|
||||
_cl(evacuation_info, surviving_young_words),
|
||||
_surviving_young_words(surviving_young_words),
|
||||
_serial_work_claim(0),
|
||||
_rs_lengths(0),
|
||||
_serial_work_claim(0),
|
||||
_parallel_work_claim(0),
|
||||
_num_work_items(collection_set->region_length()),
|
||||
_work_items(NEW_C_HEAP_ARRAY(WorkItem, _num_work_items, mtGC)) {
|
||||
|
|
|
@ -181,9 +181,6 @@ private:
|
|||
// Start a new incremental collection set for the next pause.
|
||||
void start_new_collection_set();
|
||||
|
||||
// The number of regions we could create by expansion.
|
||||
uint _expansion_regions;
|
||||
|
||||
// The block offset table for the G1 heap.
|
||||
G1BlockOffsetTable* _bot;
|
||||
|
||||
|
@ -1434,9 +1431,9 @@ public:
|
|||
G1ParScanThreadState* par_scan_state,
|
||||
RefToScanQueueSet* queues,
|
||||
ParallelTaskTerminator* terminator)
|
||||
: _g1h(g1h), _par_scan_state(par_scan_state),
|
||||
_queues(queues), _terminator(terminator),
|
||||
_start_term(0.0), _term_time(0.0), _term_attempts(0) {}
|
||||
: _start_term(0.0), _term_time(0.0), _term_attempts(0),
|
||||
_g1h(g1h), _par_scan_state(par_scan_state),
|
||||
_queues(queues), _terminator(terminator) {}
|
||||
|
||||
void do_void();
|
||||
|
||||
|
|
|
@ -57,12 +57,11 @@ G1CollectionSet::G1CollectionSet(G1CollectedHeap* g1h, G1Policy* policy) :
|
|||
_eden_region_length(0),
|
||||
_survivor_region_length(0),
|
||||
_old_region_length(0),
|
||||
_bytes_used_before(0),
|
||||
_recorded_rs_lengths(0),
|
||||
_collection_set_regions(NULL),
|
||||
_collection_set_cur_length(0),
|
||||
_collection_set_max_length(0),
|
||||
// Incremental CSet attributes
|
||||
_bytes_used_before(0),
|
||||
_recorded_rs_lengths(0),
|
||||
_inc_build_state(Inactive),
|
||||
_inc_bytes_used_before(0),
|
||||
_inc_recorded_rs_lengths(0),
|
||||
|
|
|
@ -625,7 +625,7 @@ private:
|
|||
G1CMBitMap* _bitmap;
|
||||
G1ConcurrentMark* _cm;
|
||||
public:
|
||||
G1ClearBitmapHRClosure(G1CMBitMap* bitmap, G1ConcurrentMark* cm) : HeapRegionClosure(), _cm(cm), _bitmap(bitmap) {
|
||||
G1ClearBitmapHRClosure(G1CMBitMap* bitmap, G1ConcurrentMark* cm) : HeapRegionClosure(), _bitmap(bitmap), _cm(cm) {
|
||||
}
|
||||
|
||||
virtual bool do_heap_region(HeapRegion* r) {
|
||||
|
@ -1095,7 +1095,7 @@ class G1UpdateRemSetTrackingBeforeRebuildTask : public AbstractGangTask {
|
|||
|
||||
public:
|
||||
G1UpdateRemSetTrackingBeforeRebuild(G1CollectedHeap* g1h, G1ConcurrentMark* cm, G1PrintRegionLivenessInfoClosure* cl) :
|
||||
_g1h(g1h), _cm(cm), _num_regions_selected_for_rebuild(0), _cl(cl) { }
|
||||
_g1h(g1h), _cm(cm), _cl(cl), _num_regions_selected_for_rebuild(0) { }
|
||||
|
||||
virtual bool do_heap_region(HeapRegion* r) {
|
||||
update_remset_before_rebuild(r);
|
||||
|
@ -1415,10 +1415,9 @@ class G1CMKeepAliveAndDrainClosure : public OopClosure {
|
|||
bool _is_serial;
|
||||
public:
|
||||
G1CMKeepAliveAndDrainClosure(G1ConcurrentMark* cm, G1CMTask* task, bool is_serial) :
|
||||
_cm(cm), _task(task), _is_serial(is_serial),
|
||||
_ref_counter_limit(G1RefProcDrainInterval) {
|
||||
_cm(cm), _task(task), _ref_counter_limit(G1RefProcDrainInterval),
|
||||
_ref_counter(_ref_counter_limit), _is_serial(is_serial) {
|
||||
assert(!_is_serial || _task->worker_id() == 0, "only task 0 for serial code");
|
||||
_ref_counter = _ref_counter_limit;
|
||||
}
|
||||
|
||||
virtual void do_oop(narrowOop* p) { do_oop_work(p); }
|
||||
|
|
|
@ -42,7 +42,7 @@ class G1CMBitMapClosure {
|
|||
G1ConcurrentMark* const _cm;
|
||||
G1CMTask* const _task;
|
||||
public:
|
||||
G1CMBitMapClosure(G1CMTask *task, G1ConcurrentMark* cm) : _task(task), _cm(cm) { }
|
||||
G1CMBitMapClosure(G1CMTask *task, G1ConcurrentMark* cm) : _cm(cm), _task(task) { }
|
||||
|
||||
bool do_addr(HeapWord* const addr);
|
||||
};
|
||||
|
@ -88,7 +88,7 @@ public:
|
|||
return mark_distance();
|
||||
}
|
||||
|
||||
G1CMBitMap() : _covered(), _bm(), _shifter(LogMinObjAlignment), _listener() { _listener.set_bitmap(this); }
|
||||
G1CMBitMap() : _covered(), _shifter(LogMinObjAlignment), _bm(), _listener() { _listener.set_bitmap(this); }
|
||||
|
||||
// Initializes the underlying BitMap to cover the given area.
|
||||
void initialize(MemRegion heap, G1RegionToSpaceMapper* storage);
|
||||
|
|
|
@ -74,15 +74,14 @@ public:
|
|||
};
|
||||
};
|
||||
|
||||
// The CM thread is created when the G1 garbage collector is used
|
||||
|
||||
G1ConcurrentMarkThread::G1ConcurrentMarkThread(G1ConcurrentMark* cm) :
|
||||
ConcurrentGCThread(),
|
||||
_vtime_start(0.0),
|
||||
_vtime_accum(0.0),
|
||||
_vtime_mark_accum(0.0),
|
||||
_cm(cm),
|
||||
_state(Idle),
|
||||
_phase_manager_stack(),
|
||||
_vtime_accum(0.0),
|
||||
_vtime_mark_accum(0.0) {
|
||||
_phase_manager_stack() {
|
||||
|
||||
set_name("G1 Main Marker");
|
||||
create_and_start();
|
||||
|
|
|
@ -34,11 +34,12 @@
|
|||
|
||||
G1ConcurrentRefineThread::G1ConcurrentRefineThread(G1ConcurrentRefine* cr, uint worker_id) :
|
||||
ConcurrentGCThread(),
|
||||
_vtime_start(0.0),
|
||||
_vtime_accum(0.0),
|
||||
_worker_id(worker_id),
|
||||
_active(false),
|
||||
_monitor(NULL),
|
||||
_cr(cr),
|
||||
_vtime_accum(0.0)
|
||||
_cr(cr)
|
||||
{
|
||||
// Each thread has its own monitor. The i-th thread is responsible for signaling
|
||||
// to thread i+1 if the number of buffers in the queue exceeds a threshold for this
|
||||
|
|
|
@ -41,7 +41,6 @@ class G1ConcurrentRefineThread: public ConcurrentGCThread {
|
|||
double _vtime_start; // Initial virtual time.
|
||||
double _vtime_accum; // Accumulated virtual time.
|
||||
uint _worker_id;
|
||||
uint _worker_id_offset;
|
||||
|
||||
bool _active;
|
||||
Monitor* _monitor;
|
||||
|
|
|
@ -46,7 +46,7 @@ private:
|
|||
|
||||
public:
|
||||
UpdateRSetDeferred(DirtyCardQueue* dcq) :
|
||||
_g1h(G1CollectedHeap::heap()), _ct(_g1h->card_table()), _dcq(dcq) {}
|
||||
_g1h(G1CollectedHeap::heap()), _dcq(dcq), _ct(_g1h->card_table()) {}
|
||||
|
||||
virtual void do_oop(narrowOop* p) { do_oop_work(p); }
|
||||
virtual void do_oop( oop* p) { do_oop_work(p); }
|
||||
|
@ -203,10 +203,10 @@ public:
|
|||
RemoveSelfForwardPtrHRClosure(uint worker_id,
|
||||
HeapRegionClaimer* hrclaimer) :
|
||||
_g1h(G1CollectedHeap::heap()),
|
||||
_dcq(&_g1h->dirty_card_queue_set()),
|
||||
_update_rset_cl(&_dcq),
|
||||
_worker_id(worker_id),
|
||||
_hrclaimer(hrclaimer) {
|
||||
_hrclaimer(hrclaimer),
|
||||
_dcq(&_g1h->dirty_card_queue_set()),
|
||||
_update_rset_cl(&_dcq){
|
||||
}
|
||||
|
||||
size_t remove_self_forward_ptr_by_walking_hr(HeapRegion* hr,
|
||||
|
|
|
@ -29,12 +29,14 @@
|
|||
|
||||
G1FullGCMarker::G1FullGCMarker(uint worker_id, PreservedMarks* preserved_stack, G1CMBitMap* bitmap) :
|
||||
_worker_id(worker_id),
|
||||
_bitmap(bitmap),
|
||||
_oop_stack(),
|
||||
_objarray_stack(),
|
||||
_preserved_stack(preserved_stack),
|
||||
_mark_closure(worker_id, this, G1CollectedHeap::heap()->ref_processor_stw()),
|
||||
_verify_closure(VerifyOption_G1UseFullMarking),
|
||||
_cld_closure(mark_closure()),
|
||||
_stack_closure(this),
|
||||
_preserved_stack(preserved_stack),
|
||||
_bitmap(bitmap) {
|
||||
_cld_closure(mark_closure()) {
|
||||
_oop_stack.initialize();
|
||||
_objarray_stack.initialize();
|
||||
}
|
||||
|
|
|
@ -45,7 +45,6 @@ typedef GenericTaskQueueSet<ObjArrayTaskQueue, mtGC> ObjArrayTaskQueueSet;
|
|||
class G1CMBitMap;
|
||||
|
||||
class G1FullGCMarker : public CHeapObj<mtGC> {
|
||||
private:
|
||||
uint _worker_id;
|
||||
// Backing mark bitmap
|
||||
G1CMBitMap* _bitmap;
|
||||
|
|
|
@ -39,10 +39,10 @@ void G1FullKeepAliveClosure::do_oop(narrowOop* p) { do_oop_work(p); }
|
|||
|
||||
G1VerifyOopClosure::G1VerifyOopClosure(VerifyOption option) :
|
||||
_g1h(G1CollectedHeap::heap()),
|
||||
_failures(false),
|
||||
_containing_obj(NULL),
|
||||
_verify_option(option),
|
||||
_cc(0),
|
||||
_failures(false) {
|
||||
_cc(0) {
|
||||
}
|
||||
|
||||
void G1VerifyOopClosure::print_object(outputStream* out, oop obj) {
|
||||
|
|
|
@ -61,9 +61,9 @@ class G1MarkAndPushClosure : public OopIterateClosure {
|
|||
|
||||
public:
|
||||
G1MarkAndPushClosure(uint worker, G1FullGCMarker* marker, ReferenceDiscoverer* ref) :
|
||||
OopIterateClosure(ref),
|
||||
_marker(marker),
|
||||
_worker_id(worker),
|
||||
OopIterateClosure(ref) { }
|
||||
_worker_id(worker) { }
|
||||
|
||||
template <class T> inline void do_oop_work(T* p);
|
||||
virtual void do_oop(oop* p);
|
||||
|
|
|
@ -61,8 +61,8 @@ bool G1FullGCPrepareTask::G1CalculatePointersClosure::do_heap_region(HeapRegion*
|
|||
|
||||
G1FullGCPrepareTask::G1FullGCPrepareTask(G1FullCollector* collector) :
|
||||
G1FullGCTask("G1 Prepare Compact Task", collector),
|
||||
_hrclaimer(collector->workers()),
|
||||
_freed_regions(false) {
|
||||
_freed_regions(false),
|
||||
_hrclaimer(collector->workers()) {
|
||||
}
|
||||
|
||||
void G1FullGCPrepareTask::set_freed_regions() {
|
||||
|
|
|
@ -36,8 +36,8 @@ G1FullGCScope::G1FullGCScope(GCMemoryManager* memory_manager, bool explicit_gc,
|
|||
_active(),
|
||||
_cpu_time(),
|
||||
_soft_refs(clear_soft, _g1h->soft_ref_policy()),
|
||||
_memory_stats(memory_manager, _g1h->gc_cause()),
|
||||
_collector_stats(_g1h->g1mm()->full_collection_counters()),
|
||||
_memory_stats(memory_manager, _g1h->gc_cause()),
|
||||
_heap_transition(_g1h) {
|
||||
_timer.register_gc_start();
|
||||
_tracer.report_gc_start(_g1h->gc_cause(), _timer.gc_start());
|
||||
|
|
|
@ -489,7 +489,7 @@ void G1EvacPhaseWithTrimTimeTracker::stop() {
|
|||
}
|
||||
|
||||
G1GCParPhaseTimesTracker::G1GCParPhaseTimesTracker(G1GCPhaseTimes* phase_times, G1GCPhaseTimes::GCParPhases phase, uint worker_id) :
|
||||
_phase_times(phase_times), _phase(phase), _worker_id(worker_id) {
|
||||
_start_time(), _phase(phase), _phase_times(phase_times), _worker_id(worker_id) {
|
||||
if (_phase_times != NULL) {
|
||||
_start_time = Ticks::now();
|
||||
}
|
||||
|
|
|
@ -127,7 +127,7 @@ class G1VerifyCodeRootOopClosure: public OopClosure {
|
|||
|
||||
public:
|
||||
G1VerifyCodeRootOopClosure(G1CollectedHeap* g1h, OopClosure* root_cl, VerifyOption vo):
|
||||
_g1h(g1h), _root_cl(root_cl), _vo(vo), _nm(NULL), _failures(false) {}
|
||||
_g1h(g1h), _root_cl(root_cl), _nm(NULL), _vo(vo), _failures(false) {}
|
||||
|
||||
void do_oop(oop* p) { do_oop_work(p); }
|
||||
void do_oop(narrowOop* p) { do_oop_work(p); }
|
||||
|
|
|
@ -29,7 +29,10 @@
|
|||
#include "runtime/atomic.hpp"
|
||||
|
||||
G1HotCardCache::G1HotCardCache(G1CollectedHeap *g1h):
|
||||
_g1h(g1h), _hot_cache(NULL), _use_cache(false), _card_counts(g1h) {}
|
||||
_g1h(g1h), _use_cache(false), _card_counts(g1h),
|
||||
_hot_cache(NULL), _hot_cache_size(0), _hot_cache_par_chunk_size(0),
|
||||
_hot_cache_idx(0), _hot_cache_par_claimed_idx(0)
|
||||
{}
|
||||
|
||||
void G1HotCardCache::initialize(G1RegionToSpaceMapper* card_counts_storage) {
|
||||
if (default_use_cache()) {
|
||||
|
|
|
@ -32,8 +32,8 @@
|
|||
G1IHOPControl::G1IHOPControl(double initial_ihop_percent) :
|
||||
_initial_ihop_percent(initial_ihop_percent),
|
||||
_target_occupancy(0),
|
||||
_last_allocated_bytes(0),
|
||||
_last_allocation_time_s(0.0)
|
||||
_last_allocation_time_s(0.0),
|
||||
_last_allocated_bytes(0)
|
||||
{
|
||||
assert(_initial_ihop_percent >= 0.0 && _initial_ihop_percent <= 100.0, "Initial IHOP value must be between 0 and 100 but is %.3f", initial_ihop_percent);
|
||||
}
|
||||
|
@ -86,12 +86,12 @@ G1AdaptiveIHOPControl::G1AdaptiveIHOPControl(double ihop_percent,
|
|||
size_t heap_reserve_percent,
|
||||
size_t heap_waste_percent) :
|
||||
G1IHOPControl(ihop_percent),
|
||||
_heap_reserve_percent(heap_reserve_percent),
|
||||
_heap_waste_percent(heap_waste_percent),
|
||||
_predictor(predictor),
|
||||
_marking_times_s(10, 0.95),
|
||||
_allocation_rate_s(10, 0.95),
|
||||
_last_unrestrained_young_size(0),
|
||||
_heap_reserve_percent(heap_reserve_percent),
|
||||
_heap_waste_percent(heap_waste_percent)
|
||||
_last_unrestrained_young_size(0)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -32,10 +32,11 @@ G1MemoryPoolSuper::G1MemoryPoolSuper(G1CollectedHeap* g1h,
|
|||
size_t init_size,
|
||||
size_t max_size,
|
||||
bool support_usage_threshold) :
|
||||
_g1mm(g1h->g1mm()), CollectedMemoryPool(name,
|
||||
CollectedMemoryPool(name,
|
||||
init_size,
|
||||
max_size,
|
||||
support_usage_threshold) {
|
||||
support_usage_threshold),
|
||||
_g1mm(g1h->g1mm()) {
|
||||
assert(UseG1GC, "sanity");
|
||||
}
|
||||
|
||||
|
|
|
@ -80,20 +80,24 @@ G1MonitoringSupport::G1MonitoringSupport(G1CollectedHeap* g1h) :
|
|||
_incremental_collection_counters(NULL),
|
||||
_full_collection_counters(NULL),
|
||||
_conc_collection_counters(NULL),
|
||||
_young_collection_counters(NULL),
|
||||
_old_collection_counters(NULL),
|
||||
_old_space_counters(NULL),
|
||||
_young_collection_counters(NULL),
|
||||
_eden_counters(NULL),
|
||||
_from_counters(NULL),
|
||||
_to_counters(NULL),
|
||||
|
||||
_overall_reserved(0),
|
||||
_overall_committed(0), _overall_used(0),
|
||||
_overall_committed(0),
|
||||
_overall_used(0),
|
||||
_young_region_num(0),
|
||||
_young_gen_committed(0),
|
||||
_eden_committed(0), _eden_used(0),
|
||||
_survivor_committed(0), _survivor_used(0),
|
||||
_old_committed(0), _old_used(0) {
|
||||
_eden_committed(0),
|
||||
_eden_used(0),
|
||||
_survivor_committed(0),
|
||||
_survivor_used(0),
|
||||
_old_committed(0),
|
||||
_old_used(0) {
|
||||
|
||||
_overall_reserved = g1h->max_capacity();
|
||||
recalculate_sizes();
|
||||
|
|
|
@ -162,7 +162,7 @@ class G1CLDScanClosure : public CLDClosure {
|
|||
public:
|
||||
G1CLDScanClosure(G1ParCopyHelper* closure,
|
||||
bool process_only_dirty, bool must_claim)
|
||||
: _process_only_dirty(process_only_dirty), _must_claim(must_claim), _closure(closure), _count(0) {}
|
||||
: _closure(closure), _process_only_dirty(process_only_dirty), _must_claim(must_claim), _count(0) {}
|
||||
void do_cld(ClassLoaderData* cld);
|
||||
};
|
||||
|
||||
|
|
|
@ -34,8 +34,8 @@
|
|||
#include "utilities/bitMap.inline.hpp"
|
||||
|
||||
G1PageBasedVirtualSpace::G1PageBasedVirtualSpace(ReservedSpace rs, size_t used_size, size_t page_size) :
|
||||
_low_boundary(NULL), _high_boundary(NULL), _committed(mtGC), _page_size(0), _special(false),
|
||||
_dirty(mtGC), _executable(false) {
|
||||
_low_boundary(NULL), _high_boundary(NULL), _tail_size(0), _page_size(0),
|
||||
_committed(mtGC), _dirty(mtGC), _special(false), _executable(false) {
|
||||
initialize_with_page_size(rs, used_size, page_size);
|
||||
}
|
||||
|
||||
|
|
|
@ -53,21 +53,32 @@ G1Policy::G1Policy(STWGCTimer* gc_timer) :
|
|||
_mmu_tracker(new G1MMUTrackerQueue(GCPauseIntervalMillis / 1000.0, MaxGCPauseMillis / 1000.0)),
|
||||
_ihop_control(create_ihop_control(&_predictor)),
|
||||
_policy_counters(new GCPolicyCounters("GarbageFirst", 1, 2)),
|
||||
_full_collection_start_sec(0.0),
|
||||
_collection_pause_end_millis(os::javaTimeNanos() / NANOSECS_PER_MILLISEC),
|
||||
_young_list_target_length(0),
|
||||
_young_list_fixed_length(0),
|
||||
_young_list_max_length(0),
|
||||
_short_lived_surv_rate_group(new SurvRateGroup()),
|
||||
_survivor_surv_rate_group(new SurvRateGroup()),
|
||||
_reserve_factor((double) G1ReservePercent / 100.0),
|
||||
_reserve_regions(0),
|
||||
_young_gen_sizer(),
|
||||
_free_regions_at_end_of_collection(0),
|
||||
_max_rs_lengths(0),
|
||||
_rs_lengths_prediction(0),
|
||||
_pending_cards(0),
|
||||
_bytes_allocated_in_old_since_last_gc(0),
|
||||
_initial_mark_to_mixed(),
|
||||
_collection_set(NULL),
|
||||
_bytes_copied_during_gc(0),
|
||||
_g1h(NULL),
|
||||
_phase_times(new G1GCPhaseTimes(gc_timer, ParallelGCThreads)),
|
||||
_mark_remark_start_sec(0),
|
||||
_mark_cleanup_start_sec(0),
|
||||
_tenuring_threshold(MaxTenuringThreshold),
|
||||
_max_survivor_regions(0),
|
||||
_survivors_age_table(true),
|
||||
_collection_pause_end_millis(os::javaTimeNanos() / NANOSECS_PER_MILLISEC) {
|
||||
_survivors_age_table(true)
|
||||
{
|
||||
}
|
||||
|
||||
G1Policy::~G1Policy() {
|
||||
|
|
|
@ -27,16 +27,17 @@
|
|||
#include "memory/allocation.inline.hpp"
|
||||
|
||||
G1RegionMarkStatsCache::G1RegionMarkStatsCache(G1RegionMarkStats* target, uint max_regions, uint num_cache_entries) :
|
||||
_num_stats(max_regions),
|
||||
_target(target),
|
||||
_num_stats(max_regions),
|
||||
_cache(NULL),
|
||||
_num_cache_entries(num_cache_entries),
|
||||
_cache_hits(0),
|
||||
_cache_misses(0) {
|
||||
_cache_misses(0),
|
||||
_num_cache_entries_mask(_num_cache_entries - 1) {
|
||||
|
||||
guarantee(is_power_of_2(num_cache_entries),
|
||||
"Number of cache entries must be power of two, but is %u", num_cache_entries);
|
||||
_cache = NEW_C_HEAP_ARRAY(G1RegionMarkStatsCacheEntry, _num_cache_entries, mtGC);
|
||||
_num_cache_entries_mask = _num_cache_entries - 1;
|
||||
}
|
||||
|
||||
G1RegionMarkStatsCache::~G1RegionMarkStatsCache() {
|
||||
|
|
|
@ -37,9 +37,9 @@ G1RegionToSpaceMapper::G1RegionToSpaceMapper(ReservedSpace rs,
|
|||
size_t region_granularity,
|
||||
size_t commit_factor,
|
||||
MemoryType type) :
|
||||
_listener(NULL),
|
||||
_storage(rs, used_size, page_size),
|
||||
_region_granularity(region_granularity),
|
||||
_listener(NULL),
|
||||
_commit_map(rs.size() * commit_factor / region_granularity, mtGC) {
|
||||
guarantee(is_power_of_2(page_size), "must be");
|
||||
guarantee(is_power_of_2(region_granularity), "must be");
|
||||
|
|
|
@ -282,13 +282,13 @@ public:
|
|||
G1RemSet::G1RemSet(G1CollectedHeap* g1h,
|
||||
G1CardTable* ct,
|
||||
G1HotCardCache* hot_card_cache) :
|
||||
_g1h(g1h),
|
||||
_scan_state(new G1RemSetScanState()),
|
||||
_prev_period_summary(),
|
||||
_g1h(g1h),
|
||||
_num_conc_refined_cards(0),
|
||||
_ct(ct),
|
||||
_g1p(_g1h->g1_policy()),
|
||||
_hot_card_cache(hot_card_cache),
|
||||
_prev_period_summary() {
|
||||
_hot_card_cache(hot_card_cache) {
|
||||
}
|
||||
|
||||
G1RemSet::~G1RemSet() {
|
||||
|
@ -316,8 +316,8 @@ G1ScanRSForRegionClosure::G1ScanRSForRegionClosure(G1RemSetScanState* scan_state
|
|||
_scan_objs_on_card_cl(scan_obj_on_card),
|
||||
_scan_state(scan_state),
|
||||
_worker_i(worker_i),
|
||||
_cards_claimed(0),
|
||||
_cards_scanned(0),
|
||||
_cards_claimed(0),
|
||||
_cards_skipped(0),
|
||||
_rem_set_root_scan_time(),
|
||||
_rem_set_trim_partially_time(),
|
||||
|
@ -976,8 +976,8 @@ public:
|
|||
uint n_workers,
|
||||
uint worker_id_offset) :
|
||||
AbstractGangTask("G1 Rebuild Remembered Set"),
|
||||
_cm(cm),
|
||||
_hr_claimer(n_workers),
|
||||
_cm(cm),
|
||||
_worker_id_offset(worker_id_offset) {
|
||||
}
|
||||
|
||||
|
|
|
@ -247,9 +247,10 @@ private:
|
|||
HeapRegion* max_code_root_mem_sz_region() const { return _max_code_root_mem_sz_region; }
|
||||
|
||||
public:
|
||||
HRRSStatsIter() : _all("All"), _young("Young"), _humongous("Humongous"),
|
||||
_free("Free"), _old("Old"), _max_code_root_mem_sz_region(NULL), _max_rs_mem_sz_region(NULL),
|
||||
_max_rs_mem_sz(0), _max_code_root_mem_sz(0)
|
||||
HRRSStatsIter() : _young("Young"), _humongous("Humongous"),
|
||||
_free("Free"), _old("Old"), _all("All"),
|
||||
_max_rs_mem_sz(0), _max_rs_mem_sz_region(NULL),
|
||||
_max_code_root_mem_sz(0), _max_code_root_mem_sz_region(NULL)
|
||||
{}
|
||||
|
||||
bool do_heap_region(HeapRegion* r) {
|
||||
|
|
|
@ -72,8 +72,8 @@ G1RootProcessor::G1RootProcessor(G1CollectedHeap* g1h, uint n_workers) :
|
|||
_g1h(g1h),
|
||||
_process_strong_tasks(G1RP_PS_NumElements),
|
||||
_srs(n_workers),
|
||||
_lock(Mutex::leaf, "G1 Root Scanning barrier lock", false, Monitor::_safepoint_check_never),
|
||||
_par_state_string(StringTable::weak_storage()),
|
||||
_lock(Mutex::leaf, "G1 Root Scanning barrier lock", false, Monitor::_safepoint_check_never),
|
||||
_n_workers_discovered_strong_classes(0) {}
|
||||
|
||||
void G1RootProcessor::evacuate_roots(G1ParScanThreadState* pss, uint worker_i) {
|
||||
|
|
|
@ -27,8 +27,9 @@
|
|||
#include "gc/g1/heapRegion.hpp"
|
||||
#include "logging/log.hpp"
|
||||
|
||||
G1YoungGenSizer::G1YoungGenSizer() : _sizer_kind(SizerDefaults), _adaptive_size(true),
|
||||
_min_desired_young_length(0), _max_desired_young_length(0) {
|
||||
G1YoungGenSizer::G1YoungGenSizer() : _sizer_kind(SizerDefaults),
|
||||
_min_desired_young_length(0), _max_desired_young_length(0), _adaptive_size(true) {
|
||||
|
||||
if (FLAG_IS_CMDLINE(NewRatio)) {
|
||||
if (FLAG_IS_CMDLINE(NewSize) || FLAG_IS_CMDLINE(MaxNewSize)) {
|
||||
log_warning(gc, ergo)("-XX:NewSize and -XX:MaxNewSize override -XX:NewRatio");
|
||||
|
|
|
@ -230,16 +230,19 @@ HeapRegion::HeapRegion(uint hrm_index,
|
|||
G1BlockOffsetTable* bot,
|
||||
MemRegion mr) :
|
||||
G1ContiguousSpace(bot),
|
||||
_rem_set(NULL),
|
||||
_hrm_index(hrm_index),
|
||||
_type(),
|
||||
_humongous_start_region(NULL),
|
||||
_evacuation_failed(false),
|
||||
_prev_marked_bytes(0), _next_marked_bytes(0), _gc_efficiency(0.0),
|
||||
_next(NULL), _prev(NULL),
|
||||
#ifdef ASSERT
|
||||
_containing_set(NULL),
|
||||
#endif // ASSERT
|
||||
#endif
|
||||
_prev_marked_bytes(0), _next_marked_bytes(0), _gc_efficiency(0.0),
|
||||
_young_index_in_cset(-1), _surv_rate_group(NULL), _age_index(-1),
|
||||
_rem_set(NULL), _recorded_rs_length(0), _predicted_elapsed_time_ms(0)
|
||||
_prev_top_at_mark_start(NULL), _next_top_at_mark_start(NULL),
|
||||
_recorded_rs_length(0), _predicted_elapsed_time_ms(0)
|
||||
{
|
||||
_rem_set = new HeapRegionRemSet(bot, this);
|
||||
|
||||
|
|
|
@ -128,10 +128,13 @@ public:
|
|||
|
||||
public:
|
||||
// Empty constructor, we'll initialize it with the initialize() method.
|
||||
HeapRegionManager() : _regions(), _heap_mapper(NULL), _num_committed(0),
|
||||
_next_bitmap_mapper(NULL), _prev_bitmap_mapper(NULL), _bot_mapper(NULL),
|
||||
_allocated_heapregions_length(0), _available_map(mtGC),
|
||||
_free_list("Free list", new MasterFreeRegionListMtSafeChecker())
|
||||
HeapRegionManager() :
|
||||
_regions(), _heap_mapper(NULL),
|
||||
_prev_bitmap_mapper(NULL), _next_bitmap_mapper(NULL), _bot_mapper(NULL),
|
||||
_cardtable_mapper(NULL), _card_counts_mapper(NULL),
|
||||
_free_list("Free list", new MasterFreeRegionListMtSafeChecker()),
|
||||
_available_map(mtGC), _num_committed(0),
|
||||
_allocated_heapregions_length(0)
|
||||
{ }
|
||||
|
||||
void initialize(G1RegionToSpaceMapper* heap_storage,
|
||||
|
|
|
@ -68,9 +68,10 @@ protected:
|
|||
|
||||
PerRegionTable(HeapRegion* hr) :
|
||||
_hr(hr),
|
||||
_occupied(0),
|
||||
_bm(HeapRegion::CardsPerRegion, mtGC),
|
||||
_collision_list_next(NULL), _next(NULL), _prev(NULL)
|
||||
_occupied(0),
|
||||
_next(NULL), _prev(NULL),
|
||||
_collision_list_next(NULL)
|
||||
{}
|
||||
|
||||
void add_card_work(CardIdx_t from_card, bool par) {
|
||||
|
@ -240,11 +241,14 @@ size_t OtherRegionsTable::_fine_eviction_sample_size = 0;
|
|||
|
||||
OtherRegionsTable::OtherRegionsTable(HeapRegion* hr, Mutex* m) :
|
||||
_g1h(G1CollectedHeap::heap()),
|
||||
_hr(hr), _m(m),
|
||||
_m(m),
|
||||
_hr(hr),
|
||||
_coarse_map(G1CollectedHeap::heap()->max_regions(), mtGC),
|
||||
_n_coarse_entries(0),
|
||||
_fine_grain_regions(NULL),
|
||||
_first_all_fine_prts(NULL), _last_all_fine_prts(NULL),
|
||||
_n_fine_entries(0), _n_coarse_entries(0),
|
||||
_n_fine_entries(0),
|
||||
_first_all_fine_prts(NULL),
|
||||
_last_all_fine_prts(NULL),
|
||||
_fine_eviction_start(0),
|
||||
_sparse_table(hr)
|
||||
{
|
||||
|
@ -621,10 +625,11 @@ OtherRegionsTable::do_cleanup_work(HRRSCleanupTask* hrrs_cleanup_task) {
|
|||
HeapRegionRemSet::HeapRegionRemSet(G1BlockOffsetTable* bot,
|
||||
HeapRegion* hr)
|
||||
: _bot(bot),
|
||||
_m(Mutex::leaf, FormatBuffer<128>("HeapRegionRemSet lock #%u", hr->hrm_index()), true, Monitor::_safepoint_check_never),
|
||||
_code_roots(),
|
||||
_state(Untracked),
|
||||
_other_regions(hr, &_m) {
|
||||
_m(Mutex::leaf, FormatBuffer<128>("HeapRegionRemSet lock #%u", hr->hrm_index()), true, Monitor::_safepoint_check_never),
|
||||
_other_regions(hr, &_m),
|
||||
_state(Untracked)
|
||||
{
|
||||
}
|
||||
|
||||
void HeapRegionRemSet::setup_remset_size() {
|
||||
|
@ -716,18 +721,19 @@ size_t HeapRegionRemSet::strong_code_roots_mem_size() {
|
|||
|
||||
HeapRegionRemSetIterator:: HeapRegionRemSetIterator(HeapRegionRemSet* hrrs) :
|
||||
_hrrs(hrrs),
|
||||
_g1h(G1CollectedHeap::heap()),
|
||||
_coarse_map(&hrrs->_other_regions._coarse_map),
|
||||
_bot(hrrs->_bot),
|
||||
_g1h(G1CollectedHeap::heap()),
|
||||
_n_yielded_fine(0),
|
||||
_n_yielded_coarse(0),
|
||||
_n_yielded_sparse(0),
|
||||
_is(Sparse),
|
||||
_cur_region_card_offset(0),
|
||||
// Set these values so that we increment to the first region.
|
||||
_coarse_cur_region_index(-1),
|
||||
_coarse_cur_region_cur_card(HeapRegion::CardsPerRegion-1),
|
||||
_cur_card_in_prt(HeapRegion::CardsPerRegion),
|
||||
_fine_cur_prt(NULL),
|
||||
_n_yielded_coarse(0),
|
||||
_n_yielded_fine(0),
|
||||
_n_yielded_sparse(0),
|
||||
_cur_card_in_prt(HeapRegion::CardsPerRegion),
|
||||
_sparse_iter(&hrrs->_other_regions._sparse_table) {}
|
||||
|
||||
bool HeapRegionRemSetIterator::coarse_has_next(size_t& card_index) {
|
||||
|
|
|
@ -83,9 +83,12 @@ void HeapRegionSetBase::print_on(outputStream* out, bool print_contents) {
|
|||
}
|
||||
|
||||
HeapRegionSetBase::HeapRegionSetBase(const char* name, bool humongous, bool free, HRSMtSafeChecker* mt_safety_checker)
|
||||
: _name(name), _verify_in_progress(false),
|
||||
_is_humongous(humongous), _is_free(free), _mt_safety_checker(mt_safety_checker),
|
||||
_length(0)
|
||||
: _is_humongous(humongous),
|
||||
_is_free(free),
|
||||
_mt_safety_checker(mt_safety_checker),
|
||||
_length(0),
|
||||
_name(name),
|
||||
_verify_in_progress(false)
|
||||
{ }
|
||||
|
||||
void FreeRegionList::set_unrealistically_long_length(uint len) {
|
||||
|
|
|
@ -237,8 +237,9 @@ public:
|
|||
return hr;
|
||||
}
|
||||
|
||||
FreeRegionListIterator(FreeRegionList* list) : _curr(NULL), _list(list) {
|
||||
_curr = list->_head;
|
||||
FreeRegionListIterator(FreeRegionList* list)
|
||||
: _list(list),
|
||||
_curr(list->_head) {
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -92,14 +92,20 @@ void BufferNode::deallocate(BufferNode* node) {
|
|||
|
||||
PtrQueueSet::PtrQueueSet(bool notify_when_complete) :
|
||||
_buffer_size(0),
|
||||
_max_completed_queue(0),
|
||||
_cbl_mon(NULL), _fl_lock(NULL),
|
||||
_notify_when_complete(notify_when_complete),
|
||||
_cbl_mon(NULL),
|
||||
_completed_buffers_head(NULL),
|
||||
_completed_buffers_tail(NULL),
|
||||
_n_completed_buffers(0),
|
||||
_process_completed_threshold(0), _process_completed(false),
|
||||
_buf_free_list(NULL), _buf_free_list_sz(0)
|
||||
_process_completed_threshold(0),
|
||||
_process_completed(false),
|
||||
_fl_lock(NULL),
|
||||
_buf_free_list(NULL),
|
||||
_buf_free_list_sz(0),
|
||||
_fl_owner(NULL),
|
||||
_all_active(false),
|
||||
_notify_when_complete(notify_when_complete),
|
||||
_max_completed_queue(0),
|
||||
_completed_queue_padding(0)
|
||||
{
|
||||
_fl_owner = this;
|
||||
}
|
||||
|
|
|
@ -257,7 +257,6 @@ public:
|
|||
// set, and return completed buffers to the set.
|
||||
// All these variables are are protected by the TLOQ_CBL_mon. XXX ???
|
||||
class PtrQueueSet {
|
||||
private:
|
||||
// The size of all buffers in the set.
|
||||
size_t _buffer_size;
|
||||
|
||||
|
|
|
@ -88,11 +88,15 @@ void SparsePRTEntry::copy_cards(SparsePRTEntry* e) const {
|
|||
float RSHashTable::TableOccupancyFactor = 0.5f;
|
||||
|
||||
RSHashTable::RSHashTable(size_t capacity) :
|
||||
_capacity(capacity), _capacity_mask(capacity-1),
|
||||
_occupied_entries(0), _occupied_cards(0),
|
||||
_num_entries(0),
|
||||
_capacity(capacity),
|
||||
_capacity_mask(capacity-1),
|
||||
_occupied_entries(0),
|
||||
_occupied_cards(0),
|
||||
_entries(NULL),
|
||||
_buckets(NEW_C_HEAP_ARRAY(int, capacity, mtGC)),
|
||||
_free_list(NullEntry), _free_region(0)
|
||||
_free_region(0),
|
||||
_free_list(NullEntry)
|
||||
{
|
||||
_num_entries = (capacity * TableOccupancyFactor) + 1;
|
||||
_entries = (SparsePRTEntry*)NEW_C_HEAP_ARRAY(char, _num_entries * SparsePRTEntry::size(), mtGC);
|
||||
|
|
|
@ -31,9 +31,14 @@
|
|||
#include "memory/allocation.hpp"
|
||||
|
||||
SurvRateGroup::SurvRateGroup() :
|
||||
_stats_arrays_length(0),
|
||||
_accum_surv_rate_pred(NULL),
|
||||
_last_pred(0.0),
|
||||
_surv_rate_pred(NULL),
|
||||
_stats_arrays_length(0) {
|
||||
_all_regions_allocated(0),
|
||||
_region_num(0),
|
||||
_setup_seq_num(0)
|
||||
{
|
||||
reset();
|
||||
start_adding_regions();
|
||||
}
|
||||
|
|
|
@ -47,8 +47,8 @@ VM_G1CollectForAllocation::VM_G1CollectForAllocation(size_t word_size,
|
|||
: VM_CollectForAllocation(word_size, gc_count_before, gc_cause),
|
||||
_pause_succeeded(false),
|
||||
_should_initiate_conc_mark(should_initiate_conc_mark),
|
||||
_target_pause_time_ms(target_pause_time_ms),
|
||||
_should_retry_gc(false),
|
||||
_target_pause_time_ms(target_pause_time_ms),
|
||||
_old_marking_cycles_completed_before(0) {
|
||||
guarantee(target_pause_time_ms > 0.0,
|
||||
"target_pause_time_ms = %1.6lf should be positive",
|
||||
|
|
|
@ -31,8 +31,9 @@ AdjoiningVirtualSpaces::AdjoiningVirtualSpaces(ReservedSpace rs,
|
|||
size_t min_low_byte_size,
|
||||
size_t min_high_byte_size,
|
||||
size_t alignment) :
|
||||
_high(NULL), _low(NULL),
|
||||
_reserved_space(rs), _min_low_byte_size(min_low_byte_size),
|
||||
_min_high_byte_size(min_high_byte_size), _low(0), _high(0),
|
||||
_min_high_byte_size(min_high_byte_size),
|
||||
_alignment(alignment) {}
|
||||
|
||||
// The maximum byte sizes are for the initial layout of the
|
||||
|
|
|
@ -373,9 +373,9 @@ SynchronizedGCTaskQueue::~SynchronizedGCTaskQueue() {
|
|||
//
|
||||
GCTaskManager::GCTaskManager(uint workers) :
|
||||
_workers(workers),
|
||||
_created_workers(0),
|
||||
_active_workers(0),
|
||||
_idle_workers(0),
|
||||
_created_workers(0) {
|
||||
_idle_workers(0) {
|
||||
initialize();
|
||||
}
|
||||
|
||||
|
@ -962,7 +962,7 @@ void WaitForBarrierGCTask::do_it(GCTaskManager* manager, uint which) {
|
|||
_wait_helper.notify();
|
||||
}
|
||||
|
||||
WaitHelper::WaitHelper() : _should_wait(true), _monitor(MonitorSupply::reserve()) {
|
||||
WaitHelper::WaitHelper() : _monitor(MonitorSupply::reserve()), _should_wait(true) {
|
||||
if (TraceGCTaskManager) {
|
||||
tty->print_cr("[" INTPTR_FORMAT "]"
|
||||
" WaitHelper::WaitHelper()"
|
||||
|
|
|
@ -89,7 +89,7 @@ class MutableNUMASpace : public MutableSpace {
|
|||
char* last_page_scanned() { return _last_page_scanned; }
|
||||
void set_last_page_scanned(char* p) { _last_page_scanned = p; }
|
||||
public:
|
||||
LGRPSpace(int l, size_t alignment) : _lgrp_id(l), _last_page_scanned(NULL), _allocation_failed(false) {
|
||||
LGRPSpace(int l, size_t alignment) : _lgrp_id(l), _allocation_failed(false), _last_page_scanned(NULL) {
|
||||
_space = new MutableSpace(alignment);
|
||||
_alloc_rate = new AdaptiveWeightedAverage(NUMAChunkResizeWeight);
|
||||
}
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
#include "utilities/align.hpp"
|
||||
#include "utilities/macros.hpp"
|
||||
|
||||
MutableSpace::MutableSpace(size_t alignment): ImmutableSpace(), _top(NULL), _alignment(alignment) {
|
||||
MutableSpace::MutableSpace(size_t alignment): ImmutableSpace(), _alignment(alignment), _top(NULL) {
|
||||
assert(MutableSpace::alignment() % os::vm_page_size() == 0,
|
||||
"Space should be aligned");
|
||||
_mangler = new MutableSpaceMangler(this);
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
#include "utilities/bitMap.inline.hpp"
|
||||
|
||||
inline ParMarkBitMap::ParMarkBitMap():
|
||||
_beg_bits(), _end_bits(), _region_start(NULL), _region_size(0), _virtual_space(NULL), _reserved_byte_size(0)
|
||||
_region_start(NULL), _region_size(0), _beg_bits(), _end_bits(), _virtual_space(NULL), _reserved_byte_size(0)
|
||||
{ }
|
||||
|
||||
inline void ParMarkBitMap::clear_range(idx_t beg, idx_t end) {
|
||||
|
|
|
@ -50,10 +50,10 @@ PSAdaptiveSizePolicy::PSAdaptiveSizePolicy(size_t init_eden_size,
|
|||
gc_pause_goal_sec,
|
||||
gc_cost_ratio),
|
||||
_collection_cost_margin_fraction(AdaptiveSizePolicyCollectionCostMargin / 100.0),
|
||||
_space_alignment(space_alignment),
|
||||
_live_at_last_full_gc(init_promo_size),
|
||||
_gc_minor_pause_goal_sec(gc_minor_pause_goal_sec),
|
||||
_latest_major_mutator_interval_seconds(0),
|
||||
_space_alignment(space_alignment),
|
||||
_gc_minor_pause_goal_sec(gc_minor_pause_goal_sec),
|
||||
_live_at_last_full_gc(init_promo_size),
|
||||
_young_gen_change_for_major_pause_count(0)
|
||||
{
|
||||
// Sizing policy statistics
|
||||
|
|
|
@ -2216,7 +2216,7 @@ private:
|
|||
bool _enabled;
|
||||
size_t _total_regions;
|
||||
public:
|
||||
FillableRegionLogger() : _next_index(0), _total_regions(0), _enabled(log_develop_is_enabled(Trace, gc, compaction)) { }
|
||||
FillableRegionLogger() : _next_index(0), _enabled(log_develop_is_enabled(Trace, gc, compaction)), _total_regions(0) { }
|
||||
~FillableRegionLogger() {
|
||||
log.trace(SIZE_FORMAT " initially fillable regions", _total_regions);
|
||||
}
|
||||
|
|
|
@ -49,16 +49,16 @@ AdaptiveSizePolicy::AdaptiveSizePolicy(size_t init_eden_size,
|
|||
size_t init_survivor_size,
|
||||
double gc_pause_goal_sec,
|
||||
uint gc_cost_ratio) :
|
||||
_throughput_goal(1.0 - double(1.0 / (1.0 + (double) gc_cost_ratio))),
|
||||
_eden_size(init_eden_size),
|
||||
_promo_size(init_promo_size),
|
||||
_survivor_size(init_survivor_size),
|
||||
_gc_pause_goal_sec(gc_pause_goal_sec),
|
||||
_throughput_goal(1.0 - double(1.0 / (1.0 + (double) gc_cost_ratio))),
|
||||
_gc_overhead_limit_exceeded(false),
|
||||
_print_gc_overhead_limit_would_be_exceeded(false),
|
||||
_gc_overhead_limit_count(0),
|
||||
_latest_minor_mutator_interval_seconds(0),
|
||||
_threshold_tolerance_percent(1.0 + ThresholdTolerance/100.0),
|
||||
_gc_pause_goal_sec(gc_pause_goal_sec),
|
||||
_young_gen_change_for_minor_throughput(0),
|
||||
_old_gen_change_for_major_throughput(0) {
|
||||
assert(AdaptiveSizePolicyGCTimeLimitThreshold > 0,
|
||||
|
|
|
@ -45,15 +45,15 @@ CardTable::CardTable(MemRegion whole_heap, bool conc_scan) :
|
|||
_scanned_concurrently(conc_scan),
|
||||
_whole_heap(whole_heap),
|
||||
_guard_index(0),
|
||||
_guard_region(),
|
||||
_last_valid_index(0),
|
||||
_page_size(os::vm_page_size()),
|
||||
_byte_map_size(0),
|
||||
_byte_map(NULL),
|
||||
_byte_map_base(NULL),
|
||||
_cur_covered_regions(0),
|
||||
_covered(NULL),
|
||||
_committed(NULL),
|
||||
_cur_covered_regions(0),
|
||||
_byte_map(NULL),
|
||||
_byte_map_base(NULL)
|
||||
_guard_region()
|
||||
{
|
||||
assert((uintptr_t(_whole_heap.start()) & (card_size - 1)) == 0, "heap must start at card boundary");
|
||||
assert((uintptr_t(_whole_heap.end()) & (card_size - 1)) == 0, "heap must end at card boundary");
|
||||
|
|
|
@ -45,11 +45,11 @@
|
|||
// CollectorPolicy methods
|
||||
|
||||
CollectorPolicy::CollectorPolicy() :
|
||||
_space_alignment(0),
|
||||
_heap_alignment(0),
|
||||
_initial_heap_byte_size(InitialHeapSize),
|
||||
_max_heap_byte_size(MaxHeapSize),
|
||||
_min_heap_byte_size(Arguments::min_heap_size())
|
||||
_min_heap_byte_size(Arguments::min_heap_size()),
|
||||
_space_alignment(0),
|
||||
_heap_alignment(0)
|
||||
{}
|
||||
|
||||
#ifdef ASSERT
|
||||
|
|
|
@ -79,14 +79,14 @@ inline void GCTraceTimeImpl::time_stamp(Ticks& ticks) {
|
|||
}
|
||||
|
||||
inline GCTraceTimeImpl::GCTraceTimeImpl(LogTargetHandle out_start, LogTargetHandle out_stop, const char* title, GCTimer* timer, GCCause::Cause gc_cause, bool log_heap_usage) :
|
||||
_enabled(out_stop.is_enabled()),
|
||||
_out_start(out_start),
|
||||
_out_stop(out_stop),
|
||||
_enabled(out_stop.is_enabled()),
|
||||
_start_ticks(),
|
||||
_heap_usage_before(SIZE_MAX),
|
||||
_title(title),
|
||||
_gc_cause(gc_cause),
|
||||
_timer(timer) {
|
||||
_timer(timer),
|
||||
_heap_usage_before(SIZE_MAX) {
|
||||
|
||||
time_stamp(_start_ticks);
|
||||
if (_enabled) {
|
||||
|
|
|
@ -73,8 +73,8 @@ class AdaptiveWeightedAverage : public CHeapObj<mtGC> {
|
|||
public:
|
||||
// Input weight must be between 0 and 100
|
||||
AdaptiveWeightedAverage(unsigned weight, float avg = 0.0) :
|
||||
_average(avg), _sample_count(0), _weight(weight), _last_sample(0.0),
|
||||
_is_old(false) {
|
||||
_average(avg), _sample_count(0), _weight(weight),
|
||||
_is_old(false), _last_sample(0.0) {
|
||||
}
|
||||
|
||||
void clear() {
|
||||
|
|
|
@ -73,7 +73,6 @@ GenCollectedHeap::GenCollectedHeap(GenCollectorPolicy *policy,
|
|||
Generation::Name old,
|
||||
const char* policy_counters_name) :
|
||||
CollectedHeap(),
|
||||
_rem_set(NULL),
|
||||
_young_gen_spec(new GenerationSpec(young,
|
||||
policy->initial_young_size(),
|
||||
policy->max_young_size(),
|
||||
|
@ -82,11 +81,12 @@ GenCollectedHeap::GenCollectedHeap(GenCollectorPolicy *policy,
|
|||
policy->initial_old_size(),
|
||||
policy->max_old_size(),
|
||||
policy->gen_alignment())),
|
||||
_rem_set(NULL),
|
||||
_gen_policy(policy),
|
||||
_soft_ref_gen_policy(),
|
||||
_gc_policy_counters(new GCPolicyCounters(policy_counters_name, 2, 2)),
|
||||
_process_strong_tasks(new SubTasksDone(GCH_PS_NumElements)),
|
||||
_full_collections_completed(0) {
|
||||
_full_collections_completed(0),
|
||||
_process_strong_tasks(new SubTasksDone(GCH_PS_NumElements)) {
|
||||
}
|
||||
|
||||
jint GenCollectedHeap::initialize() {
|
||||
|
|
|
@ -43,8 +43,8 @@
|
|||
#include "utilities/events.hpp"
|
||||
|
||||
Generation::Generation(ReservedSpace rs, size_t initial_size) :
|
||||
_ref_processor(NULL),
|
||||
_gc_manager(NULL) {
|
||||
_gc_manager(NULL),
|
||||
_ref_processor(NULL) {
|
||||
if (!_virtual_space.initialize(rs, initial_size)) {
|
||||
vm_exit_during_initialization("Could not reserve enough space for "
|
||||
"object heap");
|
||||
|
|
|
@ -56,7 +56,7 @@ private:
|
|||
// constructor. The need for such an constructor should be eliminated
|
||||
// when VirtualSpace and PSVirtualSpace are unified.
|
||||
GenerationCounters()
|
||||
: _name_space(NULL), _current_size(NULL), _virtual_space(NULL) {}
|
||||
: _current_size(NULL), _virtual_space(NULL), _name_space(NULL) {}
|
||||
|
||||
// This constructor is used for subclasses that do not have a space
|
||||
// associated with them (e.g, in G1).
|
||||
|
|
|
@ -104,10 +104,10 @@ ReferenceProcessor::ReferenceProcessor(BoolObjectClosure* is_subject_to_discover
|
|||
_is_subject_to_discovery(is_subject_to_discovery),
|
||||
_discovering_refs(false),
|
||||
_enqueuing_is_done(false),
|
||||
_is_alive_non_header(is_alive_non_header),
|
||||
_processing_is_mt(mt_processing),
|
||||
_next_id(0),
|
||||
_adjust_no_of_processing_threads(adjust_no_of_processing_threads)
|
||||
_adjust_no_of_processing_threads(adjust_no_of_processing_threads),
|
||||
_is_alive_non_header(is_alive_non_header)
|
||||
{
|
||||
assert(is_subject_to_discovery != NULL, "must be set");
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ class ReferenceProcessorPhaseTimes;
|
|||
// List of discovered references.
|
||||
class DiscoveredList {
|
||||
public:
|
||||
DiscoveredList() : _len(0), _compressed_head(0), _oop_head(NULL) { }
|
||||
DiscoveredList() : _oop_head(NULL), _compressed_head(0), _len(0) { }
|
||||
inline oop head() const;
|
||||
HeapWord* adr_head() {
|
||||
return UseCompressedOops ? (HeapWord*)&_compressed_head :
|
||||
|
|
|
@ -59,14 +59,17 @@ DiscoveredListIterator::DiscoveredListIterator(DiscoveredList& refs_list,
|
|||
_prev_discovered_addr(refs_list.adr_head()),
|
||||
_prev_discovered(NULL),
|
||||
_current_discovered(refs_list.head()),
|
||||
_current_discovered_addr(NULL),
|
||||
_next_discovered(NULL),
|
||||
_referent_addr(NULL),
|
||||
_referent(NULL),
|
||||
_keep_alive(keep_alive),
|
||||
_is_alive(is_alive),
|
||||
#ifdef ASSERT
|
||||
_first_seen(refs_list.head()),
|
||||
#endif
|
||||
_processed(0),
|
||||
_removed(0),
|
||||
_next_discovered(NULL),
|
||||
_keep_alive(keep_alive),
|
||||
_is_alive(is_alive) {
|
||||
_removed(0) {
|
||||
}
|
||||
|
||||
#endif // SHARE_VM_GC_SHARED_REFERENCEPROCESSOR_INLINE_HPP
|
||||
|
|
|
@ -164,7 +164,7 @@ RefProcPhaseTimeTracker::~RefProcPhaseTimeTracker() {
|
|||
RefProcTotalPhaseTimesTracker::RefProcTotalPhaseTimesTracker(ReferenceProcessor::RefProcPhases phase_number,
|
||||
ReferenceProcessorPhaseTimes* phase_times,
|
||||
ReferenceProcessor* rp) :
|
||||
_rp(rp), RefProcPhaseTimeBaseTracker(phase_enum_2_phase_string(phase_number), phase_number, phase_times) {
|
||||
RefProcPhaseTimeBaseTracker(phase_enum_2_phase_string(phase_number), phase_number, phase_times), _rp(rp) {
|
||||
}
|
||||
|
||||
RefProcTotalPhaseTimesTracker::~RefProcTotalPhaseTimesTracker() {
|
||||
|
@ -173,7 +173,7 @@ RefProcTotalPhaseTimesTracker::~RefProcTotalPhaseTimesTracker() {
|
|||
}
|
||||
|
||||
ReferenceProcessorPhaseTimes::ReferenceProcessorPhaseTimes(GCTimer* gc_timer, uint max_gc_threads) :
|
||||
_gc_timer(gc_timer), _processing_is_mt(false) {
|
||||
_processing_is_mt(false), _gc_timer(gc_timer) {
|
||||
|
||||
for (uint i = 0; i < ReferenceProcessor::RefSubPhaseMax; i++) {
|
||||
_sub_phases_worker_time_sec[i] = new WorkerDataArray<double>(max_gc_threads, SubPhasesParWorkTitle[i]);
|
||||
|
|
|
@ -289,7 +289,7 @@ public:
|
|||
DirtyCardToOopClosure(Space* sp, OopIterateClosure* cl,
|
||||
CardTable::PrecisionStyle precision,
|
||||
HeapWord* boundary) :
|
||||
_sp(sp), _cl(cl), _precision(precision), _boundary(boundary),
|
||||
_cl(cl), _sp(sp), _precision(precision), _boundary(boundary),
|
||||
_min_done(NULL) {
|
||||
NOT_PRODUCT(_last_bottom = NULL);
|
||||
NOT_PRODUCT(_last_explicit_min_done = NULL);
|
||||
|
|
|
@ -88,7 +88,7 @@ class DeadSpacer : StackObj {
|
|||
CompactibleSpace* _space;
|
||||
|
||||
public:
|
||||
DeadSpacer(CompactibleSpace* space) : _space(space), _allowed_deadspace_words(0) {
|
||||
DeadSpacer(CompactibleSpace* space) : _allowed_deadspace_words(0), _space(space) {
|
||||
size_t ratio = _space->allowed_dead_ratio();
|
||||
_active = ratio > 0;
|
||||
|
||||
|
|
|
@ -224,8 +224,8 @@ volatile size_t StringDedupTable::_claimed_index = 0;
|
|||
StringDedupTable::StringDedupTable(size_t size, jint hash_seed) :
|
||||
_size(size),
|
||||
_entries(0),
|
||||
_grow_threshold((uintx)(size * _grow_load_factor)),
|
||||
_shrink_threshold((uintx)(size * _shrink_load_factor)),
|
||||
_grow_threshold((uintx)(size * _grow_load_factor)),
|
||||
_rehash_needed(false),
|
||||
_hash_seed(hash_seed) {
|
||||
assert(is_power_of_2(size), "Table size must be a power of 2");
|
||||
|
|
|
@ -115,7 +115,7 @@ private:
|
|||
static GlobalTLABStats* global_stats() { return _global_stats; }
|
||||
|
||||
public:
|
||||
ThreadLocalAllocBuffer() : _allocation_fraction(TLABAllocationWeight), _allocated_before_last_gc(0) {
|
||||
ThreadLocalAllocBuffer() : _allocated_before_last_gc(0), _allocation_fraction(TLABAllocationWeight) {
|
||||
// do nothing. tlabs must be inited by initialize() calls
|
||||
}
|
||||
|
||||
|
|
|
@ -186,7 +186,7 @@ VM_CollectForMetadataAllocation::VM_CollectForMetadataAllocation(ClassLoaderData
|
|||
uint full_gc_count_before,
|
||||
GCCause::Cause gc_cause)
|
||||
: VM_GC_Operation(gc_count_before, gc_cause, full_gc_count_before, true),
|
||||
_loader_data(loader_data), _size(size), _mdtype(mdtype), _result(NULL) {
|
||||
_result(NULL), _size(size), _mdtype(mdtype), _loader_data(loader_data) {
|
||||
assert(_size != 0, "An allocation should always be requested with this operation.");
|
||||
AllocTracer::send_allocation_requiring_gc_event(_size * HeapWordSize, GCId::peek());
|
||||
}
|
||||
|
@ -282,7 +282,7 @@ void VM_CollectForMetadataAllocation::doit() {
|
|||
}
|
||||
|
||||
VM_CollectForAllocation::VM_CollectForAllocation(size_t word_size, uint gc_count_before, GCCause::Cause cause)
|
||||
: VM_GC_Operation(gc_count_before, cause), _result(NULL), _word_size(word_size) {
|
||||
: VM_GC_Operation(gc_count_before, cause), _word_size(word_size), _result(NULL) {
|
||||
// Only report if operation was really caused by an allocation.
|
||||
if (_word_size != 0) {
|
||||
AllocTracer::send_allocation_requiring_gc_event(_word_size * HeapWordSize, GCId::peek());
|
||||
|
|
|
@ -31,10 +31,10 @@
|
|||
|
||||
template <typename T>
|
||||
WorkerDataArray<T>::WorkerDataArray(uint length, const char* title) :
|
||||
_title(title),
|
||||
_length(0) {
|
||||
_data(NULL),
|
||||
_length(length),
|
||||
_title(title) {
|
||||
assert(length > 0, "Must have some workers to store data for");
|
||||
_length = length;
|
||||
_data = NEW_C_HEAP_ARRAY(T, _length, mtGC);
|
||||
for (uint i = 0; i < MaxThreadWorkItems; i++) {
|
||||
_thread_work_items[i] = NULL;
|
||||
|
|
|
@ -187,12 +187,13 @@ class MutexGangTaskDispatcher : public GangTaskDispatcher {
|
|||
Monitor* _monitor;
|
||||
|
||||
public:
|
||||
MutexGangTaskDispatcher()
|
||||
: _task(NULL),
|
||||
_monitor(new Monitor(Monitor::leaf, "WorkGang dispatcher lock", false, Monitor::_safepoint_check_never)),
|
||||
MutexGangTaskDispatcher() :
|
||||
_task(NULL),
|
||||
_started(0),
|
||||
_finished(0),
|
||||
_num_workers(0) {}
|
||||
_num_workers(0),
|
||||
_monitor(new Monitor(Monitor::leaf, "WorkGang dispatcher lock", false, Monitor::_safepoint_check_never)) {
|
||||
}
|
||||
|
||||
~MutexGangTaskDispatcher() {
|
||||
delete _monitor;
|
||||
|
@ -408,7 +409,7 @@ void WorkGangBarrierSync::abort() {
|
|||
// SubTasksDone functions.
|
||||
|
||||
SubTasksDone::SubTasksDone(uint n) :
|
||||
_n_tasks(n), _tasks(NULL) {
|
||||
_tasks(NULL), _n_tasks(n), _threads_completed(0) {
|
||||
_tasks = NEW_C_HEAP_ARRAY(uint, n, mtInternal);
|
||||
guarantee(_tasks != NULL, "alloc failure");
|
||||
clear();
|
||||
|
|
|
@ -130,10 +130,11 @@ class AbstractWorkGang : public CHeapObj<mtInternal> {
|
|||
|
||||
public:
|
||||
AbstractWorkGang(const char* name, uint workers, bool are_GC_task_threads, bool are_ConcurrentGC_threads) :
|
||||
_name(name),
|
||||
_workers(NULL),
|
||||
_total_workers(workers),
|
||||
_active_workers(UseDynamicNumberOfGCThreads ? 1U : workers),
|
||||
_created_workers(0),
|
||||
_name(name),
|
||||
_are_GC_task_threads(are_GC_task_threads),
|
||||
_are_ConcurrentGC_threads(are_ConcurrentGC_threads)
|
||||
{ }
|
||||
|
|
|
@ -83,8 +83,8 @@ public:
|
|||
ZStatSamplerHistoryInterval() :
|
||||
_next(0),
|
||||
_samples(),
|
||||
_total(),
|
||||
_accumulated() {}
|
||||
_accumulated(),
|
||||
_total() {}
|
||||
|
||||
bool add(const ZStatSamplerData& new_sample) {
|
||||
// Insert sample
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue