2

We have Set 120 GB Max Memory in Redis Server.

So in info output used_memory is always less than equal to 120GB but used_memory_rss is ~140GB

Can Someone Please explain the reason of this?

Jaroslaw Pawlak
  • 5,270
  • 7
  • 26
  • 52
  • That's because the memory gets fragmented during runtime. – Itamar Haber Nov 03 '15 at 15:09
  • But Why it is more than 120. OS Should not give more memory to Redis Process defined in 'maxmemory' . If it try to give, OS itself can go OOM. – Virender Dubey Nov 03 '15 at 15:32
  • I just want to understand why it is more than defined parameter 'maxmemory'. In my understanding Redis should not use memory more than 'maxmemory', because we have already given 95% of the total RAM to Redis Process. – Virender Dubey Nov 03 '15 at 15:34

1 Answers1

4

Total used memory includes any memory Redis has used outside of data storage, in particular various buffers and memory used during disk persistence operations such as BGSAVE and AOF rewrites. The maxmemory setting is for the amount of data allowed (and includes some buffers such as client buffers) - not total system memory.

When you reach maxmemory Redis will stop allowing added memory usage through data commands. But it is still free to use memory outside of that to handle it's other duties.

The Real Bill
  • 12,841
  • 7
  • 33
  • 36