RFR (XS) 8071770 G1 does not implement millis_since_last_gc which is needed by RMI GC

Thomas Schatzl thomas.schatzl at oracle.com
Tue Jul 19 08:10:04 UTC 2016


Hi Joe,

On Fri, 2016-07-15 at 11:34 -0400, Joseph Provino wrote:
> Hi Thomas, does this look better?
> 
> I'm not sure it's exactly what you said.  Let me know and I'll change
> it.
> 
> joe
> 
>    2476  jlong G1CollectedHeap::millis_since_last_gc() {
>    2477    // We need a monotonically non-decreasing time in ms but
>    2478    // os::javaTimeNanos() used by os::elapsed_counter()
>    2479    // does not guarantee monotonicity.

I would prefer a comment like: "See the notes in
GenCollectedHeap::millis_since_last_gc() for more information about the
implementation.

And fix the comment in GenCollectedHeap::millis_since_last_gc() as you
did here.

>    2480    jlong now = os::elapsed_counter() / NANOSECS_PER_MILLISEC;
>    2481    const G1Analytics* analytics = _g1_policy->analytics();
>    2482    double last = analytics->last_known_gc_end_time_sec();
>    2483    jlong ret_val = now - (last * 1000);
>    2484    if (ret_val < 0) {
>    2485      log_warning(gc)("millis_since_last_gc() would return :
>> JLONG_FORMAT
>    2486        ". Returning zero instead.", ret_val);
>    2487      return 0;
>    2488    }
>    2489    return ret_val;
>    2490  }

Thanks,
  Thomas


More information about the hotspot-gc-dev mailing list