g1CollectedHeap.cpp (8869:ad916ca3715b) | g1CollectedHeap.cpp (8870:57093b085a8f) |
---|---|
1/* 2 * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * This code is free software; you can redistribute it and/or modify it 6 * under the terms of the GNU General Public License version 2 only, as 7 * published by the Free Software Foundation. 8 * --- 3746 unchanged lines hidden (view full) --- 3755 cl.total_humongous(), 3756 cl.candidate_humongous()); 3757 _has_humongous_reclaim_candidates = cl.candidate_humongous() > 0; 3758 3759 // Finally flush all remembered set entries to re-check into the global DCQS. 3760 cl.flush_rem_set_entries(); 3761} 3762 | 1/* 2 * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * This code is free software; you can redistribute it and/or modify it 6 * under the terms of the GNU General Public License version 2 only, as 7 * published by the Free Software Foundation. 8 * --- 3746 unchanged lines hidden (view full) --- 3755 cl.total_humongous(), 3756 cl.candidate_humongous()); 3757 _has_humongous_reclaim_candidates = cl.candidate_humongous() > 0; 3758 3759 // Finally flush all remembered set entries to re-check into the global DCQS. 3760 cl.flush_rem_set_entries(); 3761} 3762 |
3763void 3764G1CollectedHeap::setup_surviving_young_words() { | 3763void G1CollectedHeap::setup_surviving_young_words() { |
3765 assert(_surviving_young_words == NULL, "pre-condition"); 3766 uint array_length = g1_policy()->young_cset_region_length(); 3767 _surviving_young_words = NEW_C_HEAP_ARRAY(size_t, (size_t) array_length, mtGC); 3768 if (_surviving_young_words == NULL) { 3769 vm_exit_out_of_memory(sizeof(size_t) * array_length, OOM_MALLOC_ERROR, 3770 "Not enough space for young surv words summary."); 3771 } 3772 memset(_surviving_young_words, 0, (size_t) array_length * sizeof(size_t)); 3773#ifdef ASSERT 3774 for (uint i = 0; i < array_length; ++i) { 3775 assert( _surviving_young_words[i] == 0, "memset above" ); 3776 } 3777#endif // !ASSERT 3778} 3779 | 3764 assert(_surviving_young_words == NULL, "pre-condition"); 3765 uint array_length = g1_policy()->young_cset_region_length(); 3766 _surviving_young_words = NEW_C_HEAP_ARRAY(size_t, (size_t) array_length, mtGC); 3767 if (_surviving_young_words == NULL) { 3768 vm_exit_out_of_memory(sizeof(size_t) * array_length, OOM_MALLOC_ERROR, 3769 "Not enough space for young surv words summary."); 3770 } 3771 memset(_surviving_young_words, 0, (size_t) array_length * sizeof(size_t)); 3772#ifdef ASSERT 3773 for (uint i = 0; i < array_length; ++i) { 3774 assert( _surviving_young_words[i] == 0, "memset above" ); 3775 } 3776#endif // !ASSERT 3777} 3778 |
3780void 3781G1CollectedHeap::update_surviving_young_words(size_t* surv_young_words) { 3782 MutexLockerEx x(ParGCRareEvent_lock, Mutex::_no_safepoint_check_flag); | 3779void G1CollectedHeap::update_surviving_young_words(size_t* surv_young_words) { 3780 assert_at_safepoint(true); |
3783 uint array_length = g1_policy()->young_cset_region_length(); 3784 for (uint i = 0; i < array_length; ++i) { 3785 _surviving_young_words[i] += surv_young_words[i]; 3786 } 3787} 3788 | 3781 uint array_length = g1_policy()->young_cset_region_length(); 3782 for (uint i = 0; i < array_length; ++i) { 3783 _surviving_young_words[i] += surv_young_words[i]; 3784 } 3785} 3786 |
3789void 3790G1CollectedHeap::cleanup_surviving_young_words() { | 3787void G1CollectedHeap::cleanup_surviving_young_words() { |
3791 guarantee( _surviving_young_words != NULL, "pre-condition" ); 3792 FREE_C_HEAP_ARRAY(size_t, _surviving_young_words); 3793 _surviving_young_words = NULL; 3794} 3795 3796#ifdef ASSERT 3797class VerifyCSetClosure: public HeapRegionClosure { 3798public: --- 801 unchanged lines hidden (view full) --- 4600 evac_term_attempts = evac.term_attempts(); 4601 term_sec = evac.term_time(); 4602 double elapsed_sec = os::elapsedTime() - start; 4603 _g1h->g1_policy()->phase_times()->add_time_secs(G1GCPhaseTimes::ObjCopy, worker_id, elapsed_sec - term_sec); 4604 _g1h->g1_policy()->phase_times()->record_time_secs(G1GCPhaseTimes::Termination, worker_id, term_sec); 4605 _g1h->g1_policy()->phase_times()->record_thread_work_item(G1GCPhaseTimes::Termination, worker_id, evac_term_attempts); 4606 } 4607 | 3788 guarantee( _surviving_young_words != NULL, "pre-condition" ); 3789 FREE_C_HEAP_ARRAY(size_t, _surviving_young_words); 3790 _surviving_young_words = NULL; 3791} 3792 3793#ifdef ASSERT 3794class VerifyCSetClosure: public HeapRegionClosure { 3795public: --- 801 unchanged lines hidden (view full) --- 4597 evac_term_attempts = evac.term_attempts(); 4598 term_sec = evac.term_time(); 4599 double elapsed_sec = os::elapsedTime() - start; 4600 _g1h->g1_policy()->phase_times()->add_time_secs(G1GCPhaseTimes::ObjCopy, worker_id, elapsed_sec - term_sec); 4601 _g1h->g1_policy()->phase_times()->record_time_secs(G1GCPhaseTimes::Termination, worker_id, term_sec); 4602 _g1h->g1_policy()->phase_times()->record_thread_work_item(G1GCPhaseTimes::Termination, worker_id, evac_term_attempts); 4603 } 4604 |
4608 // Flush any statistics. 4609 _g1h->g1_policy()->record_thread_age_table(pss->age_table()); 4610 _g1h->update_surviving_young_words(pss->surviving_young_words()); 4611 | |
4612 assert(pss->queue_is_empty(), "should be empty"); 4613 4614 if (PrintTerminationStats) { 4615 MutexLockerEx x(ParGCRareEvent_lock, Mutex::_no_safepoint_check_flag); 4616 size_t lab_waste; 4617 size_t lab_undo_waste; 4618 pss->waste(lab_waste, lab_undo_waste); 4619 _g1h->print_termination_stats(gclog_or_tty, --- 2180 unchanged lines hidden --- | 4605 assert(pss->queue_is_empty(), "should be empty"); 4606 4607 if (PrintTerminationStats) { 4608 MutexLockerEx x(ParGCRareEvent_lock, Mutex::_no_safepoint_check_flag); 4609 size_t lab_waste; 4610 size_t lab_undo_waste; 4611 pss->waste(lab_waste, lab_undo_waste); 4612 _g1h->print_termination_stats(gclog_or_tty, --- 2180 unchanged lines hidden --- |