The present invention provides a method and computing device for a memory cache
system, wherein the memory cache
system is used to store key-value objects, and the method comprises: creating a cache instance according to a specified
cache capacity and an estimated number of objects, wherein the cache instance comprises a small
queue and a main
queue, wherein the small
queue is used to store objects that are recent or have an
access frequency lower than an access threshold, and the main queue is used to store objects whose
access frequency is equal to and / or greater than the access threshold; writing the objects to be cached to the cache instance, and always performing a write operation to the small queue; wherein, when the
cache capacity is insufficient, the cache key-value objects are preferentially eliminated from the small queue. According to the technical solution of the present invention, a high
cache hit rate can be guaranteed,
cache pollution can be reduced, memory security and
concurrency can be guaranteed, and the development and maintenance of the cache
system can be simplified.