< prev index next >
src/hotspot/share/gc/g1/g1CollectedHeap.cpp
Print this page
rev 59939 : [mq]: 8243974-investigate-millis-since-last-gc-move
*** 1478,1487 ****
--- 1478,1489 ----
CollectedHeap(),
_young_gen_sampling_thread(NULL),
_workers(NULL),
_card_table(NULL),
_soft_ref_policy(),
+ _collection_pause_end(Ticks::now()),
+ _time_of_last_gc_ns(os::javaTimeNanos()),
_old_set("Old Region Set", new OldRegionSetChecker()),
_archive_set("Archive Region Set", new ArchiveRegionSetChecker()),
_humongous_set("Humongous Region Set", new HumongousRegionSetChecker()),
_bot(NULL),
_listener(),
*** 2429,2439 ****
}
jlong G1CollectedHeap::millis_since_last_gc() {
// See the notes in GenCollectedHeap::millis_since_last_gc()
// for more information about the implementation.
! jlong ret_val = (os::javaTimeNanos() - _policy->time_of_last_gc()) /
NANOSECS_PER_MILLISEC;
if (ret_val < 0) {
NOT_PRODUCT(log_warning(gc)("time warp: " JLONG_FORMAT, ret_val);)
return 0;
}
--- 2431,2441 ----
}
jlong G1CollectedHeap::millis_since_last_gc() {
// See the notes in GenCollectedHeap::millis_since_last_gc()
// for more information about the implementation.
! jlong ret_val = (os::javaTimeNanos() - _time_of_last_gc_ns) /
NANOSECS_PER_MILLISEC;
if (ret_val < 0) {
NOT_PRODUCT(log_warning(gc)("time warp: " JLONG_FORMAT, ret_val);)
return 0;
}
*** 2724,2733 ****
--- 2726,2737 ----
// policy with the new heap occupancy
Universe::update_heap_info_at_gc();
// Print NUMA statistics.
_numa->print_statistics();
+
+ _collection_pause_end = Ticks::now();
}
void G1CollectedHeap::verify_numa_regions(const char* desc) {
LogTarget(Trace, gc, heap, verify) lt;
*** 3118,3127 ****
--- 3122,3133 ----
expand_heap_after_young_collection();
double sample_end_time_sec = os::elapsedTime();
double pause_time_ms = (sample_end_time_sec - sample_start_time_sec) * MILLIUNITS;
policy()->record_collection_pause_end(pause_time_ms);
+
+ _time_of_last_gc_ns = os::javaTimeNanos();
}
verify_after_young_collection(verify_type);
gc_epilogue(false);
< prev index next >