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

Joseph Provino joseph.provino at oracle.com
Tue Jul 19 14:12:01 UTC 2016


Hi Thomas, I'm not sure what you mean by fix the comment in 
GenCollectedHeap.

Do you mean change the logging message?

   if (retVal < 0) {
     NOT_PRODUCT(log_warning(gc)("time warp: " JLONG_FORMAT, retVal);)
     return 0;
   }

   if (ret_val < 0) {
     log_warning(gc)("millis_since_last_gc() would return : " JLONG_FORMAT
       ". returning zero instead.", ret_val);
     return 0;
   }

joe

On 7/19/2016 4:10 AM, Thomas Schatzl wrote:
> 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