RFR: Move periodic GC decision making to base GC heuristics class

Zhengyu Gu zgu at redhat.com
Thu Jul 19 19:59:04 UTC 2018



On 07/19/2018 02:38 PM, Aleksey Shipilev wrote:
> On 07/19/2018 08:34 PM, Zhengyu Gu wrote:
>> Please review this simple cleanup.
>>
>> Currently, the same periodic GC decision is made by heuristics subclasses overall the places, while
>> it can be made by base class.
>>
>>
>> Webrev: http://cr.openjdk.java.net/~zgu/shenandoah/periodic_gc/webrev.00/
> 
> Looks good. You can avoid excess branches like this:
> 
> bool ShenandoahCompactHeuristics::should_start_normal_gc() {
>     ...
>     if (available < threshold_bytes_allocated || bytes_allocated > threshold_bytes_allocated) {
>       ...
>       return true;
>     }
> 
>     return ShenandoahHeuristics::should_start_normal_gc();
>   }
> 
> It also highlights we fallback to super-implementation if nothing is taken in this method.
Okay.

Updated: 
http://cr.openjdk.java.net/~zgu/shenandoah/periodic_gc/webrev.01/index.html

Thanks,

-Zhengyu



> 
> -Aleksey
> 


More information about the shenandoah-dev mailing list