memory on davidchua https://dchua.com/tags/memory/ Recent content in memory on davidchua Hugo -- gohugo.io en-us Tue, 28 Apr 2015 00:00:00 +0000 Debugging Redis and its Memory https://dchua.com/posts/2015-04-28-debugging-redis-and-its-memory/ Tue, 28 Apr 2015 00:00:00 +0000 https://dchua.com/posts/2015-04-28-debugging-redis-and-its-memory/ To determine the size of a key redis-cli> DEBUG OBJECT <keyname> Value at:0x7ffc8f8eb330 refcount:1 encoding:linkedlist serializedlength:1175841791 lru:416416 lru_seconds_idle:30 serializedlength is in bytes. To print out the size of each key in your redis-database Checkout this script To tweak Redis from overloading your memory Add vm.overcommit_memory = 1 to /etc/sysctl.conf and then reboot or run the command sysctl vm.overcommit_memory=1 for this to take effect immediately. To limit the size of your redis database # /etc/redis/redis.