CacheMap extends the basic hashmap type by adding a limit to the number of items contained at any given time. In addition, CacheMap sorts the cache entries such that those entries frequently accessed are at the head of the queue, and those least frequently accessed are at the tail. When the queue becomes full, old entries are dropped from the tail and are reused to house new cache entries.