In a data storage device, a system of method of optimizing cache
management. A method includes selecting a set of cache management
algorithms associated with a predetermined pattern in a sequence of
commands. Statistics based on a sequence of commands are gathered and a
pattern is detected from the statistics. The pattern is associated with
predetermined known patterns to identify a set of cache management
algorithms that are optimized for the known pattern. A system includes
usage statistics that are correlated among a set of known usage patterns.
A switch chooses the set of cache management algorithms associated with
the known pattern that most closely matches the usage statistics.