< prev index next >
src/hotspot/share/gc/shared/collectedHeap.cpp
Print this page
rev 60420 : imported patch 8248401-Refactor-unify-RMI-gc-support-functionality
@@ -189,10 +189,11 @@
// Memory state functions.
CollectedHeap::CollectedHeap() :
_is_gc_active(false),
+ _last_whole_heap_examined_time_ns(os::javaTimeNanos()),
_total_collections(0),
_total_full_collections(0),
_gc_cause(GCCause::_no_gc),
_gc_lastcause(GCCause::_no_gc)
{
@@ -486,10 +487,18 @@
thread->tlab().resize();
}
}
}
+jlong CollectedHeap::millis_since_last_whole_heap_examined() {
+ return (os::javaTimeNanos() - _last_whole_heap_examined_time_ns) / NANOSECS_PER_MILLISEC;
+}
+
+void CollectedHeap::next_whole_heap_examined() {
+ _last_whole_heap_examined_time_ns = os::javaTimeNanos();
+}
+
void CollectedHeap::full_gc_dump(GCTimer* timer, bool before) {
assert(timer != NULL, "timer is null");
if ((HeapDumpBeforeFullGC && before) || (HeapDumpAfterFullGC && !before)) {
GCTraceTime(Info, gc) tm(before ? "Heap Dump (before full gc)" : "Heap Dump (after full gc)", timer);
HeapDumper::dump_heap();
< prev index next >