The invention discloses a strategy optimization method for cache
garbage collection, relates to the technical field of computer
cache management, and is used for solving the problem of low cache collection efficiency. According to the method, a cache
storage area is abstracted into a plurality of cache partitions, a partition
state vector composed of capacity, access and fragmentation degree operation indexes is constructed for each partition, and a strategy evaluation thread periodically reads the partition state vectors to calculate garbage recycling pressure and recycling priority. The upper limit of the number of scanning objects and the upper limit of time slices are distributed for the target cache partition by combining the
idle time proportion of the processor, and a recycling execution thread conducts incremental recycling in a batch mode according to a strategy
list and records the recycling progress; after
recovery, index weight and scanning configuration are adjusted according to release capacity, fragment degree change, hit times and back-to-source request change, so that garbage
recovery gives consideration to release space and overhead, the
hit rate and the memory
utilization rate are improved, and pause and invalid
recovery caused by centralized recovery are reduced.