Patent ID: 7818505

Claim:
A method of managing a cache memory in a mass-storage system, said method comprising: defining a plurality of groups of allocation units, each group of allocation units based on a number of allocation units; receiving a new allocation unit; creating a new group of allocation units if the new allocation unit is not associated with any of the plurality of groups of allocation units based on the operative criteria; adding the new allocation unit to one of the plurality of groups of allocation units if the new allocation unit is associated with the one of the plurality of groups of allocation units; and managing the cache in terms of groups of allocation units, rather than in terms of discrete allocation units, wherein said managing comprises: defining a plurality of replacement queues for the plurality of groups of allocation units, each replacement queue associated with a different number of allocation units or a different range of allocation units, assigning each group of allocation units to a replacement queue, each respective group of allocation units assigned to the replacement queue including a same associated number of allocation units or to the replacement queue including a range of allocation units within which the number of allocation units for a particular group of allocation units falls within, re-assigning the one of the plurality of groups of allocation units to a different replacement queue based on the addition of the new allocation unit modifying the number of allocation units in the one of the plurality of groups of allocation units, and associating each replacement queue with a predefined aging factor based on the number of allocation units or the range of allocation units.