Redis data is stored in memory. As the system runs, more and more redis data will lead to insufficient physical memory. The virtual memory (VM) is used to swap infrequently accessed data to the disk and free up the memory space to solve the problem of insufficient physical memory.
Redis VM only exchanges value to the disk, while the key still exists in the memory to quickly locate the value on the disk and improve performance. Therefore, if the physical memory is insufficient due to too many keys, it cannot be solved through the VM method.
Redis also exchanges files by PAGE and disk. Only one redis object can be saved on one page, but one redis object can be saved in multiple pages.
When the redis memory exceeds a value (this value is set through configuration), the value is exchanged to the swap file on the disk. The value selection method is for objects that are infrequently accessed and occupy a large amount of memory space.
Redis virtual memory