I would like Redis to return some memory. I lowered the maxmemory by 10GB but noticed Redis is still "holding onto it" in RSS based on "used_memory_rss". Based on http://redis.io/topics/memory-optimization, it looks like Redis won't return the memory to the OS. How do I force this? Is there any way to do this without restarting Redis?
I had the same problem and this answer was helpful.
even though Redis isn’t using the memory anymore, the allocator just hasn’t released the memory back to the OS yet. Reds v4 has a
MEMORY PURGEcommand to tell the allocator to release the memory it isn’t using, but unfortunately that isn’t available to you on v3.2.
It is possible to reconfigure redis on the fly but it won't re-read the config file until the next restart. To do this you have to use the
CONFIG command to change the value.
Changing Redis configuration while the server is running It is possible to reconfigure Redis on the fly without stopping and restarting the service, or querying the current configuration programmatically using the special commands CONFIG SET and CONFIG GET Not all the configuration directives are supported in this way, but most are supported as expected. Please refer to the CONFIG SET and CONFIG GET pages for more information. Note that modifying the configuration on the fly has no effects on the redis.conf file so at the next restart of Redis the old configuration will be used instead. Make sure to also modify the redis.conf file accordingly to the configuration you set using CONFIG SET. You can do it manually, or starting with Redis 2.8, you can just use CONFIG REWRITE, which will automatically scan your redis.conf file and update the fields which don't match the current configuration value. Fields non existing but set to the default value are not added. Comments inside your configuration file are retained.
If that doesn't work and you have a slave you could play a shell game with them and reduce the memory on the slave, restart it, promote that to the master and reduce the memory on the original master and restart it.