RFR: 8198515: Extract SoftReferencePolicy code out of CollectorPolicy

Stefan Karlsson stefan.karlsson at oracle.com
Wed Feb 21 17:59:02 UTC 2018


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