src/share/vm/memory/generation.hpp

Print this page
rev 2869 : 7117303: VM uses non-monotonic time source and complains that it is non-monotonic
Summary: Replaces calls to os::javaTimeMillis(), which does not guarantee montonicity, in GC code to os::javaTimeNanos() with a suitable conversion factor. os::javaTimeNanos() mostly guarantees montonicity depending on the underlying OS implementation and, as a result, a better alternative. Changes in OS files are to make use of the newly defined constants in globalDefinitions.hpp.
Reviewed-by:


 399   // allowing a collection.  The default is to do nothing.
 400   virtual void gc_prologue(bool full) {};
 401 
 402   // Some generations may require some cleanup actions after a collection.
 403   // The default is to do nothing.
 404   virtual void gc_epilogue(bool full) {};
 405 
 406   // Save the high water marks for the used space in a generation.
 407   virtual void record_spaces_top() {};
 408 
 409   // Some generations may need to be "fixed-up" after some allocation
 410   // activity to make them parsable again. The default is to do nothing.
 411   virtual void ensure_parsability() {};
 412 
 413   // Time (in ms) when we were last collected or now if a collection is
 414   // in progress.
 415   virtual jlong time_of_last_gc(jlong now) {
 416     // XXX See note in genCollectedHeap::millis_since_last_gc()
 417     NOT_PRODUCT(
 418       if (now < _time_of_last_gc) {
 419         warning("time warp: %d to %d", _time_of_last_gc, now);
 420       }
 421     )
 422     return _time_of_last_gc;
 423   }
 424 
 425   virtual void update_time_of_last_gc(jlong now)  {
 426     _time_of_last_gc = now;
 427   }
 428 
 429   // Generations may keep statistics about collection.  This
 430   // method updates those statistics.  current_level is
 431   // the level of the collection that has most recently
 432   // occurred.  This allows the generation to decide what
 433   // statistics are valid to collect.  For example, the
 434   // generation can decide to gather the amount of promoted data
 435   // if the collection of the younger generations has completed.
 436   GCStats* gc_stats() const { return _gc_stats; }
 437   virtual void update_gc_stats(int current_level, bool full) {}
 438 
 439   // Mark sweep support phase2




 399   // allowing a collection.  The default is to do nothing.
 400   virtual void gc_prologue(bool full) {};
 401 
 402   // Some generations may require some cleanup actions after a collection.
 403   // The default is to do nothing.
 404   virtual void gc_epilogue(bool full) {};
 405 
 406   // Save the high water marks for the used space in a generation.
 407   virtual void record_spaces_top() {};
 408 
 409   // Some generations may need to be "fixed-up" after some allocation
 410   // activity to make them parsable again. The default is to do nothing.
 411   virtual void ensure_parsability() {};
 412 
 413   // Time (in ms) when we were last collected or now if a collection is
 414   // in progress.
 415   virtual jlong time_of_last_gc(jlong now) {
 416     // XXX See note in genCollectedHeap::millis_since_last_gc()
 417     NOT_PRODUCT(
 418       if (now < _time_of_last_gc) {
 419         warning("time warp: "INT64_FORMAT" to "INT64_FORMAT, _time_of_last_gc, now);
 420       }
 421     )
 422     return _time_of_last_gc;
 423   }
 424 
 425   virtual void update_time_of_last_gc(jlong now)  {
 426     _time_of_last_gc = now;
 427   }
 428 
 429   // Generations may keep statistics about collection.  This
 430   // method updates those statistics.  current_level is
 431   // the level of the collection that has most recently
 432   // occurred.  This allows the generation to decide what
 433   // statistics are valid to collect.  For example, the
 434   // generation can decide to gather the amount of promoted data
 435   // if the collection of the younger generations has completed.
 436   GCStats* gc_stats() const { return _gc_stats; }
 437   virtual void update_gc_stats(int current_level, bool full) {}
 438 
 439   // Mark sweep support phase2