sripathikrishnan / redis-rdb-tools

Parse Redis dump.rdb files, Analyze Memory, and Export Data to JSON
https://rdbtools.com
MIT License
5.1k stars 744 forks source link

Reduce memory usage when print n most large keys #199

Open HonestManXin opened 3 weeks ago

HonestManXin commented 3 weeks ago

I have a rdb file about 3GB size, and i want to get the n most largest keys. When i run the rdb tool in k8s pod with 8G memory, the rdb tools was killed due to cgroup memory limit. The PrintAllKeys would hold all the records in the heap, but in fact we only need n most largest record in the heap. At the same time, too many record in the heap also cost more cpu when push record in the heap. After change to n-fixed size heap, the cost time reduced from 20min to 18min in my case.

smilyFw commented 3 weeks ago

   您好,我已收到您的邮件,谢谢!!~~