@@ -1417,6 +1417,7 @@ G1CollectedHeap::G1CollectedHeap() :
1417
1417
_young_gen_sampling_thread(NULL ),
1418
1418
_workers(NULL ),
1419
1419
_card_table(NULL ),
1420
+ _collection_pause_end(Ticks::now()),
1420
1421
_soft_ref_policy(),
1421
1422
_old_set(" Old Region Set" , new OldRegionSetChecker()),
1422
1423
_archive_set(" Archive Region Set" , new ArchiveRegionSetChecker()),
@@ -1966,7 +1967,8 @@ void G1CollectedHeap::increment_old_marking_cycles_started() {
1966
1967
_old_marking_cycles_started++;
1967
1968
}
1968
1969
1969
- void G1CollectedHeap::increment_old_marking_cycles_completed (bool concurrent) {
1970
+ void G1CollectedHeap::increment_old_marking_cycles_completed (bool concurrent,
1971
+ bool whole_heap_examined) {
1970
1972
MonitorLocker ml (G1OldGCCount_lock, Mutex::_no_safepoint_check_flag);
1971
1973
1972
1974
// We assume that if concurrent == true, then the caller is a
@@ -1998,6 +2000,10 @@ void G1CollectedHeap::increment_old_marking_cycles_completed(bool concurrent) {
1998
2000
_old_marking_cycles_started, _old_marking_cycles_completed);
1999
2001
2000
2002
_old_marking_cycles_completed += 1 ;
2003
+ if (whole_heap_examined) {
2004
+ // Signal that we have completed a visit to all live objects.
2005
+ record_whole_heap_examined_timestamp ();
2006
+ }
2001
2007
2002
2008
// We need to clear the "in_progress" flag in the CM thread before
2003
2009
// we wake up any waiters (especially when ExplicitInvokesConcurrent
@@ -2366,19 +2372,6 @@ size_t G1CollectedHeap::max_reserved_capacity() const {
2366
2372
return _hrm->max_length () * HeapRegion::GrainBytes;
2367
2373
}
2368
2374
2369
- jlong G1CollectedHeap::millis_since_last_gc () {
2370
- // See the notes in GenCollectedHeap::millis_since_last_gc()
2371
- // for more information about the implementation.
2372
- jlong ret_val = (os::javaTimeNanos () / NANOSECS_PER_MILLISEC) -
2373
- _policy->collection_pause_end_millis ();
2374
- if (ret_val < 0 ) {
2375
- log_warning (gc)(" millis_since_last_gc() would return : " JLONG_FORMAT
2376
- " . returning zero instead." , ret_val);
2377
- return 0 ;
2378
- }
2379
- return ret_val;
2380
- }
2381
-
2382
2375
void G1CollectedHeap::deduplicate_string (oop str) {
2383
2376
assert (java_lang_String::is_instance (str), " invariant" );
2384
2377
@@ -2641,7 +2634,7 @@ void G1CollectedHeap::gc_epilogue(bool full) {
2641
2634
// Update common counters.
2642
2635
if (full) {
2643
2636
// Update the number of full collections that have been completed.
2644
- increment_old_marking_cycles_completed (false /* concurrent */ );
2637
+ increment_old_marking_cycles_completed (false /* concurrent */ , true /* liveness_completed */ );
2645
2638
}
2646
2639
2647
2640
// We are at the end of the GC. Total collections has already been increased.
@@ -2665,6 +2658,8 @@ void G1CollectedHeap::gc_epilogue(bool full) {
2665
2658
2666
2659
// Print NUMA statistics.
2667
2660
_numa->print_statistics ();
2661
+
2662
+ _collection_pause_end = Ticks::now ();
2668
2663
}
2669
2664
2670
2665
void G1CollectedHeap::verify_numa_regions (const char * desc) {
0 commit comments