Class ClockProPlusPolicy

  • All Implemented Interfaces:
    Policy, Policy.KeyOnlyPolicy

    public final class ClockProPlusPolicy
    extends Object
    implements Policy.KeyOnlyPolicy
    The ClockProPlus algorithm. This algorithm differs from ClockPro by adjusting the coldTarget with the utility-driven adaption idea borrowed from CAR. The algorithm is explained by the authors in CLOCK-Pro+: improving CLOCK-Pro cache replacement with utility-driven adaptation. Implementation here differs from ClockProPolicy only in adjusting coldTarget and tracking for demoted status part. Below is a summary of coldTarget adjusting differences between ClockPro and ClockPro+.
     
     +-----------------------------------------------------------------------------------+
     |                  ClockPro ColdTarget Adaption Algorithm Summary                   |
     +------+----------+-----------------------------------------------------------------+
     | When | increase |                                     access in test period pages |
     |      | decrease |                           test period is expired without access |
     +------+----------+-----------------------------------------------------------------+
     | Size | increase |                                                              +1 |
     |      | decrease |                                                              -1 |
     +------+----------+-----------------------------------------------------------------+
     |                  ClockPro+ ColdTarget Adaption Algorithm Summary                  |
     +------+----------+-----------------------------------------------------------------+
     | When | increase |                                    access in non-resident pages |
     |      | decrease |                                access in demoted from hot pages |
     |      |          |  * Note: demoted from hot pages ⊂ resident cold but not in test |
     +------+----------+-----------------------------------------------------------------+
     | Size | increase |         d = (demoted size / non-resident size); d < 1 ? +1 : +d |
     |      | decrease |         d = (non-resident size / demoted size); d < 1 ? -1 : -d |
     +------+----------+-----------------------------------------------------------------+
     
     
    This algorithm uses non-resident cold entries size to calculate adaption size so changing non-resident-multiplier may affect the adaption algorithm. In the author's research code percent-max-resident-cold was set to 0.5x.
    • Constructor Detail

      • ClockProPlusPolicy

        public ClockProPlusPolicy​(Config config)
    • Method Detail

      • stats

        public PolicyStats stats()
        Description copied from interface: Policy
        Returns the cache efficiency statistics.
        Specified by:
        stats in interface Policy
      • finished

        public void finished()
        Description copied from interface: Policy
        Indicates that the recording has completed.
        Specified by:
        finished in interface Policy