Help Center/ Distributed Cache Service/ FAQs/ Big/Hot Key Analysis/ Why Does Memory Usage Decrease After Big Key Analysis Is Performed on Redis?
Updated on 2023-09-28 GMT+08:00

Why Does Memory Usage Decrease After Big Key Analysis Is Performed on Redis?

Big key analysis only queries keys that occupy a large space and does not delete the keys. Due to the lazy free deletion mechanism, keys are not deleted immediately upon expiration, unless they are accessed or identified. During a big key analysis, all keys are traversed, and the expired keys will be identified and then deleted. As a result, memory usage decreases after a big key analysis is completed.

For details about how expired keys are deleted and how to scan for expired keys, see Scanning Expired Keys.