RFR: 8198515: Extract SoftReferencePolicy code out of CollectorPolicy

Per Liden per.liden at oracle.com
Thu Feb 22 13:13:24 UTC 2018


Looks good. I agree that there are more things to clean up in the soft 
ref area, but this is a good first strep.

/Per

On 02/21/2018 08:33 PM, Stefan Karlsson wrote:
> Hi all,
> 
> Updated webrevs:
>   http://cr.openjdk.java.net/~stefank/8198515/webrev.02.delta/
>   http://cr.openjdk.java.net/~stefank/8198515/webrev.02/
> 
> I realized that I could get rid of the set_size_policy code by simply 
> fetching the size_policy() from the GenCollectedHeap. That way, I don't 
> add any behavioral changes to this patch.
> 
> I also added _soft_ref_gen_policy to the initializer list.
> 
> Thanks,
> StefanK
> 
> On 2018-02-21 18:59, Stefan Karlsson wrote:
>> Hi all,
>>
>> Please review this patch to move code related to SoftReference 
>> handling out from CollectorPolicy into its own classes and files.
>>
>>  http://cr.openjdk.java.net/~stefank/8198515/webrev.01/
>>  https://bugs.openjdk.java.net/browse/JDK-8198515
>>
>> This patch simply reduces the code in CollectorPolicy, as a step 
>> towards JDK-8198505. There might be some future cleanups that could be 
>> done here in the future.
>>
>> Note the addition in genCollectedHeap.cpp:
>> +  // Connect the two policies.
>> + _soft_ref_gen_policy.set_size_policy(_gen_policy->size_policy());
>>
>> There might be possible to straighten up this code, so that the 
>> size_policy gets set up earlier, before the SoftRefGenPolicy instance. 
>> If/when that happens, we could set this field in the constructor and 
>> get rid of this line.
>>
>> Thanks,
>> StefanK
> 
> 


More information about the hotspot-gc-dev mailing list