< prev index next >

src/hotspot/share/gc/g1/g1CollectedHeap.hpp

Print this page
rev 60257 : [mq]: 8248401-unify-millis-since-last-gc

@@ -157,10 +157,12 @@
   G1YoungRemSetSamplingThread* _young_gen_sampling_thread;
 
   WorkGang* _workers;
   G1CardTable* _card_table;
 
+  Ticks _collection_pause_end;
+
   SoftRefPolicy      _soft_ref_policy;
 
   static size_t _humongous_object_threshold_in_words;
 
   // These sets keep track of old, archive and humongous regions respectively.

@@ -642,11 +644,13 @@
   // in this nesting (i.e., the concurrent cycle). Further nesting is
   // not currently supported. The end of this call also notifies
   // the G1OldGCCount_lock in case a Java thread is waiting for a full
   // GC to happen (e.g., it called System.gc() with
   // +ExplicitGCInvokesConcurrent).
-  void increment_old_marking_cycles_completed(bool concurrent);
+  // liveness_completed should indicate that during that old marking
+  // cycle the whole heap has actually been examined for live objects.
+  void increment_old_marking_cycles_completed(bool concurrent, bool liveness_completed);
 
   uint old_marking_cycles_completed() {
     return _old_marking_cycles_completed;
   }
 

@@ -1286,12 +1290,11 @@
   virtual size_t max_capacity() const;
 
   // Return the size of reserved memory. Returns different value than max_capacity() when AllocateOldGenAt is used.
   virtual size_t max_reserved_capacity() const;
 
-  virtual jlong millis_since_last_gc();
-
+  Tickspan time_since_last_collection() const { return Ticks::now() - _collection_pause_end; }
 
   // Convenience function to be used in situations where the heap type can be
   // asserted to be this type.
   static G1CollectedHeap* heap() {
     return named_heap<G1CollectedHeap>(CollectedHeap::G1);
< prev index next >