< prev index next >
src/hotspot/share/gc/g1/g1CollectedHeap.cpp
Print this page
rev 60422 : [mq]: 8248401-ayang-review
*** 1415,1424 ****
--- 1415,1425 ----
G1CollectedHeap::G1CollectedHeap() :
CollectedHeap(),
_young_gen_sampling_thread(NULL),
_workers(NULL),
_card_table(NULL),
+ _collection_pause_end(Ticks::now()),
_soft_ref_policy(),
_old_set("Old Region Set", new OldRegionSetChecker()),
_archive_set("Archive Region Set", new ArchiveRegionSetChecker()),
_humongous_set("Humongous Region Set", new HumongousRegionSetChecker()),
_bot(NULL),
*** 1964,1974 ****
_old_marking_cycles_started, _old_marking_cycles_completed);
_old_marking_cycles_started++;
}
! void G1CollectedHeap::increment_old_marking_cycles_completed(bool concurrent) {
MonitorLocker ml(G1OldGCCount_lock, Mutex::_no_safepoint_check_flag);
// We assume that if concurrent == true, then the caller is a
// concurrent thread that was joined the Suspendible Thread
// Set. If there's ever a cheap way to check this, we should add an
--- 1965,1976 ----
_old_marking_cycles_started, _old_marking_cycles_completed);
_old_marking_cycles_started++;
}
! void G1CollectedHeap::increment_old_marking_cycles_completed(bool concurrent,
! bool whole_heap_examined) {
MonitorLocker ml(G1OldGCCount_lock, Mutex::_no_safepoint_check_flag);
// We assume that if concurrent == true, then the caller is a
// concurrent thread that was joined the Suspendible Thread
// Set. If there's ever a cheap way to check this, we should add an
*** 1996,2005 ****
--- 1998,2011 ----
"_old_marking_cycles_started = %u "
"is inconsistent with _old_marking_cycles_completed = %u",
_old_marking_cycles_started, _old_marking_cycles_completed);
_old_marking_cycles_completed += 1;
+ if (whole_heap_examined) {
+ // Signal that we have completed a visit to all live objects.
+ record_whole_heap_examined_timestamp();
+ }
// We need to clear the "in_progress" flag in the CM thread before
// we wake up any waiters (especially when ExplicitInvokesConcurrent
// is set) so that if a waiter requests another System.gc() it doesn't
// incorrectly see that a marking cycle is still in progress.
*** 2364,2386 ****
size_t G1CollectedHeap::max_reserved_capacity() const {
return _hrm->max_length() * HeapRegion::GrainBytes;
}
- 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() / NANOSECS_PER_MILLISEC) -
- _policy->collection_pause_end_millis();
- if (ret_val < 0) {
- log_warning(gc)("millis_since_last_gc() would return : " JLONG_FORMAT
- ". returning zero instead.", ret_val);
- return 0;
- }
- return ret_val;
- }
-
void G1CollectedHeap::deduplicate_string(oop str) {
assert(java_lang_String::is_instance(str), "invariant");
if (G1StringDedup::is_enabled()) {
G1StringDedup::deduplicate(str);
--- 2370,2379 ----
*** 2639,2649 ****
void G1CollectedHeap::gc_epilogue(bool full) {
// Update common counters.
if (full) {
// Update the number of full collections that have been completed.
! increment_old_marking_cycles_completed(false /* concurrent */);
}
// We are at the end of the GC. Total collections has already been increased.
rem_set()->print_periodic_summary_info("After GC RS summary", total_collections() - 1);
--- 2632,2642 ----
void G1CollectedHeap::gc_epilogue(bool full) {
// Update common counters.
if (full) {
// Update the number of full collections that have been completed.
! increment_old_marking_cycles_completed(false /* concurrent */, true /* liveness_completed */);
}
// We are at the end of the GC. Total collections has already been increased.
rem_set()->print_periodic_summary_info("After GC RS summary", total_collections() - 1);
*** 2663,2672 ****
--- 2656,2667 ----
// 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;
< prev index next >