comparison src/share/vm/gc_implementation/concurrentMarkSweep/concurrentMarkSweepGeneration.cpp @ 1703:f6f3eef8a521

6581734: CMS Old Gen's collection usage is zero after GC which is incorrect Summary: Management code enabled for use by a concurrent collector. Reviewed-by: mchung, ysr
author kevinw
date Fri, 30 Jul 2010 22:43:50 +0100
parents e9ff18c4ace7
children 63f4675ac87d
comparison
equal deleted inserted replaced
1594:b9bc732be7c0 1703:f6f3eef8a521
1968 _cmsGen->cmsSpace()->beginSweepFLCensus((float)(_inter_sweep_timer.seconds()), 1968 _cmsGen->cmsSpace()->beginSweepFLCensus((float)(_inter_sweep_timer.seconds()),
1969 _inter_sweep_estimate.padded_average(), 1969 _inter_sweep_estimate.padded_average(),
1970 _intra_sweep_estimate.padded_average()); 1970 _intra_sweep_estimate.padded_average());
1971 } 1971 }
1972 1972
1973 {
1974 TraceCMSMemoryManagerStats();
1975 }
1973 GenMarkSweep::invoke_at_safepoint(_cmsGen->level(), 1976 GenMarkSweep::invoke_at_safepoint(_cmsGen->level(),
1974 ref_processor(), clear_all_soft_refs); 1977 ref_processor(), clear_all_soft_refs);
1975 #ifdef ASSERT 1978 #ifdef ASSERT
1976 CompactibleFreeListSpace* cms_space = _cmsGen->cmsSpace(); 1979 CompactibleFreeListSpace* cms_space = _cmsGen->cmsSpace();
1977 size_t free_size = cms_space->free(); 1980 size_t free_size = cms_space->free();
3418 // this generation. [Note this initial checkpoint need only 3421 // this generation. [Note this initial checkpoint need only
3419 // be approximate -- we'll do a catch up phase subsequently.] 3422 // be approximate -- we'll do a catch up phase subsequently.]
3420 void CMSCollector::checkpointRootsInitial(bool asynch) { 3423 void CMSCollector::checkpointRootsInitial(bool asynch) {
3421 assert(_collectorState == InitialMarking, "Wrong collector state"); 3424 assert(_collectorState == InitialMarking, "Wrong collector state");
3422 check_correct_thread_executing(); 3425 check_correct_thread_executing();
3426 TraceCMSMemoryManagerStats tms(_collectorState);
3423 ReferenceProcessor* rp = ref_processor(); 3427 ReferenceProcessor* rp = ref_processor();
3424 SpecializationStats::clear(); 3428 SpecializationStats::clear();
3425 assert(_restart_addr == NULL, "Control point invariant"); 3429 assert(_restart_addr == NULL, "Control point invariant");
3426 if (asynch) { 3430 if (asynch) {
3427 // acquire locks for subsequent manipulations 3431 // acquire locks for subsequent manipulations
4751 assert(_collectorState == FinalMarking, "incorrect state transition?"); 4755 assert(_collectorState == FinalMarking, "incorrect state transition?");
4752 check_correct_thread_executing(); 4756 check_correct_thread_executing();
4753 // world is stopped at this checkpoint 4757 // world is stopped at this checkpoint
4754 assert(SafepointSynchronize::is_at_safepoint(), 4758 assert(SafepointSynchronize::is_at_safepoint(),
4755 "world should be stopped"); 4759 "world should be stopped");
4760 TraceCMSMemoryManagerStats tms(_collectorState);
4756 verify_work_stacks_empty(); 4761 verify_work_stacks_empty();
4757 verify_overflow_empty(); 4762 verify_overflow_empty();
4758 4763
4759 SpecializationStats::clear(); 4764 SpecializationStats::clear();
4760 if (PrintGCDetails) { 4765 if (PrintGCDetails) {
5852 assert(_collectorState == Sweeping, "just checking"); 5857 assert(_collectorState == Sweeping, "just checking");
5853 check_correct_thread_executing(); 5858 check_correct_thread_executing();
5854 verify_work_stacks_empty(); 5859 verify_work_stacks_empty();
5855 verify_overflow_empty(); 5860 verify_overflow_empty();
5856 increment_sweep_count(); 5861 increment_sweep_count();
5862 TraceCMSMemoryManagerStats tms(_collectorState);
5863
5857 _inter_sweep_timer.stop(); 5864 _inter_sweep_timer.stop();
5858 _inter_sweep_estimate.sample(_inter_sweep_timer.seconds()); 5865 _inter_sweep_estimate.sample(_inter_sweep_timer.seconds());
5859 size_policy()->avg_cms_free_at_sweep()->sample(_cmsGen->free()); 5866 size_policy()->avg_cms_free_at_sweep()->sample(_cmsGen->free());
5860 5867
5861 // PermGen verification support: If perm gen sweeping is disabled in 5868 // PermGen verification support: If perm gen sweeping is disabled in
9124 _dead_bit_map->mark(addr); // mark the dead object 9131 _dead_bit_map->mark(addr); // mark the dead object
9125 } 9132 }
9126 } 9133 }
9127 return res; 9134 return res;
9128 } 9135 }
9136
9137 TraceCMSMemoryManagerStats::TraceCMSMemoryManagerStats(CMSCollector::CollectorState phase): TraceMemoryManagerStats() {
9138
9139 switch (phase) {
9140 case CMSCollector::InitialMarking:
9141 initialize(true /* fullGC */ ,
9142 true /* recordGCBeginTime */,
9143 true /* recordPreGCUsage */,
9144 false /* recordPeakUsage */,
9145 false /* recordPostGCusage */,
9146 true /* recordAccumulatedGCTime */,
9147 false /* recordGCEndTime */,
9148 false /* countCollection */ );
9149 break;
9150
9151 case CMSCollector::FinalMarking:
9152 initialize(true /* fullGC */ ,
9153 false /* recordGCBeginTime */,
9154 false /* recordPreGCUsage */,
9155 false /* recordPeakUsage */,
9156 false /* recordPostGCusage */,
9157 true /* recordAccumulatedGCTime */,
9158 false /* recordGCEndTime */,
9159 false /* countCollection */ );
9160 break;
9161
9162 case CMSCollector::Sweeping:
9163 initialize(true /* fullGC */ ,
9164 false /* recordGCBeginTime */,
9165 false /* recordPreGCUsage */,
9166 true /* recordPeakUsage */,
9167 true /* recordPostGCusage */,
9168 false /* recordAccumulatedGCTime */,
9169 true /* recordGCEndTime */,
9170 true /* countCollection */ );
9171 break;
9172
9173 default:
9174 ShouldNotReachHere();
9175 }
9176 }
9177
9178 // when bailing out of cms in concurrent mode failure
9179 TraceCMSMemoryManagerStats::TraceCMSMemoryManagerStats(): TraceMemoryManagerStats() {
9180 initialize(true /* fullGC */ ,
9181 true /* recordGCBeginTime */,
9182 true /* recordPreGCUsage */,
9183 true /* recordPeakUsage */,
9184 true /* recordPostGCusage */,
9185 true /* recordAccumulatedGCTime */,
9186 true /* recordGCEndTime */,
9187 true /* countCollection */ );
9188 }
9189