Which segments to clean?
Greedy policy
- clean segments that are most fragmented
Cost-benefit policy
- value of cleaning a segment depends on:
- cost: segment utilization
- benefit: segment utilization and time to stay free
- select a segment with highest benefit/cost
Notes:
Greedy policy - most fragmented segment cleaned first
cold segments stay around much longer
BUT - free space in cold segments are much valuable - they stay around longer
hot segment - data die quickly - so wait a little longer to get the free space even larger
how to find stability of a data in a segment:
assumption: older the data in a segment, longer it will remain unchanged
segment-usage table: # of live blocks + last modification time