US 11,940,923 B1
Cost based cache eviction
Andrew Samnick, Seattle, WA (US); Jacob Shannan Carr, Seattle, WA (US); and Sean Robert Connell, Seattle, WA (US)
Assigned to Amazon Technologies, Inc., Seattle, WA (US)
Filed by Amazon Technologies, Inc., Seattle, WA (US)
Filed on Dec. 11, 2019, as Appl. No. 16/711,296.
Int. Cl. G06F 12/0891 (2016.01); G06F 9/30 (2018.01); G06F 9/54 (2006.01); G06F 11/30 (2006.01); G06F 11/34 (2006.01); G06F 12/121 (2016.01); G06F 12/123 (2016.01); G06F 12/128 (2016.01); H04L 67/1097 (2022.01); H04L 67/5682 (2022.01)
CPC G06F 12/0891 (2013.01) [G06F 9/30047 (2013.01); G06F 9/546 (2013.01); G06F 11/3037 (2013.01); G06F 11/3442 (2013.01); G06F 12/121 (2013.01); G06F 12/123 (2013.01); G06F 12/128 (2013.01); H04L 67/1097 (2013.01); H04L 67/5682 (2022.05); G06F 2201/81 (2013.01); G06F 2201/885 (2013.01)] 21 Claims
OG exemplary drawing
 
12. A non-transitory machine readable storage medium including instructions embodied thereon, wherein the instructions, when executed by at least one processor:
store a plurality of cache entries at a cache in a computer memory, individual ones of the cache entries including respective computed data and a plurality of cost measures of different cost types, wherein for the individual one of the cache entries, respective ones of the cost measures of the different cost types represent respective different computing costs for respective different types of resources to generate the computed data for the respective cache entries;
record respective frequencies of access at which the respective individual cache entries are accessed;
receive an incoming cache entry to add to the cache, wherein the incoming cache entry includes a plurality of cost measures of the different cost types received from an application creating the cache entries;
identify a cache entry to evict from the cache, wherein the cache entry to be evicted has a total cost that is lower than the respective total cost for other ones of the cache entries, wherein respective total cost for respective ones of the cache entries:
is computed as one of the cost measures, stored in the respective cache entry, that represents a currently constrained resource, combined with the frequency of access of the respective cache entry; or
is based on a weighted combination of the plurality of cost measures, stored in the respective cache entry, combined with the frequency of access of the respective cache entry;
remove the cache entry identified to be evicted from the cache; and
write the incoming cache entry, including the plurality of cost measures of the different cost types received from the application, into the cache stored in the computer memory.