slot已经迁移到其他节点,但是,内存未释放

问一下, 我当前节点上有1200个slot,占用的物理内存大概是17.4G, 我把其中的200个slot迁移到其他节点了, 但是,查看redis的物理内存占用,只是少了几百K, 几乎是没有释放,请问,这是啥原因啊? 求大神们指点一下。 谢谢!

参与7

3同行回答

AndiAndi软件开发工程师Yucheng tech
好的,大神,我做一下主从切换 试一下, 谢谢!显示全部

好的,大神,我做一下主从切换 试一下, 谢谢!

收起
软件开发 · 2017-05-08
浏览2557
WentasyWentasy数据库管理员ChainONE
迁移后,内存不会立即释放,除非人为为主节点建立从节点,手动释放。显示全部

迁移后,内存不会立即释放,除非人为为主节点建立从节点,手动释放。

收起
互联网服务 · 2017-05-06
浏览2757
  • Andi  Andi
    主从切换之后,内存就会释谢谢。 谢谢大神。
    2017-05-09
liucj2004liucj2004其它undefined
https://redis.io/topics/memory-optimizationMemory allocation这一章节Redis will not always free up (return) memory to the OS when keys are removed. This is not something special about Redis, but it is how most malloc() implementations work. For exampl...显示全部

https://redis.io/topics/memory-optimization
Memory allocation这一章节
Redis will not always free up (return) memory to the OS when keys are removed. This is not something special about Redis, but it is how most malloc() implementations work. For example if you fill an instance with 5GB worth of data, and then remove the equivalent of 2GB of data, the Resident Set Size (also known as the RSS, which is the number of memory pages consumed by the process) will probably still be around 5GB, even if Redis will claim that the user memory is around 3GB. This happens because the underlying allocator can't easily release the memory. For example often most of the removed keys were allocated in the same pages as the other keys that still exist.
简单说,因为内存交给系统管理,所以删除(迁移走)key时不会很快的释放内存。
要很快释放的话,冻结主节点,让从节点接管,重启原主节点,然后再接管回来。

收起
农业其它 · 2017-05-05
浏览2875

提问者

Andi
软件开发工程师Yucheng tech

问题来自

相关问题

相关资料

相关文章

问题状态

  • 发布时间:2017-05-05
  • 关注会员:3 人
  • 问题浏览:6185
  • 最近回答:2017-05-08
  • X社区推广