title: Redis memory usage, ZSET and docker
body: <p>I have a redis instance (3.2) on docker (official image) which is pretty much unused, except the script I launched every second, to unqueue potential items in a ZSET.
  Here is my script:</p>
  
  <pre><code>local latestSchedule = redis.call('ZRANGEBYSCORE', KEYS[1], '-inf', 123456789, 'LIMIT', '0', '1')
  if latestSchedule[1] == nil then return nil end
  redis.call('ZREM', KEYS[1], latestSchedule[1])
  return latestSchedule[1]
  </code></pre>
  
  <p>Even though this ZSET is most of the time empty, Redis is eating more and more memory, up to 128MB, until it restarts and goes up again.</p>
  
  <p>Am I missing something?
  Is redis memory usage usually growing without doing anything?
  Is my script not well suited for unqueuing from a ZSET?
  Should  I watch somewhere else?</p>
  
  <p>As per Karthikeyan Gopall request, here is the INFO, just before it reaches 128MB:</p>
  
  <pre><code># Server
  redis_version:3.2.0
  redis_git_sha1:00000000
  redis_git_dirty:0
  redis_build_id:5382f69a4e75566b
  redis_mode:standalone
  os:Linux 3.16.0-4-amd64 x86_64
  arch_bits:64
  multiplexing_api:epoll
  gcc_version:4.9.2
  process_id:1
  run_id:4e22b73f22436677376b4d097746c2a30ba2b9bc
  tcp_port:6379
  uptime_in_seconds:21140
  uptime_in_days:0
  hz:10
  lru_clock:6816977
  executable:/data/redis-server
  config_file:
  
  # Clients
  connected_clients:5
  client_longest_output_list:0
  client_biggest_input_buf:0
  blocked_clients:0
  
  # Memory
  used_memory:33392560
  used_memory_human:31.85M
  used_memory_rss:125399040
  used_memory_rss_human:119.59M
  used_memory_peak:33473544
  used_memory_peak_human:31.92M
  total_system_memory:1787236352
  total_system_memory_human:1.66G
  used_memory_lua:67447808
  used_memory_lua_human:64.32M
  maxmemory:134217728
  maxmemory_human:128.00M
  maxmemory_policy:noeviction
  mem_fragmentation_ratio:3.76
  mem_allocator:jemalloc-4.0.3
  
  # Persistence
  loading:0
  rdb_changes_since_last_save:162
  rdb_bgsave_in_progress:0
  rdb_last_save_time:1466413629
  rdb_last_bgsave_status:ok
  rdb_last_bgsave_time_sec:-1
  rdb_current_bgsave_time_sec:-1
  aof_enabled:1
  aof_rewrite_in_progress:0
  aof_rewrite_scheduled:0
  aof_last_rewrite_time_sec:-1
  aof_current_rewrite_time_sec:-1
  aof_last_bgrewrite_status:ok
  aof_last_write_status:ok
  aof_current_size:1039856
  aof_base_size:0
  aof_pending_rewrite:0
  aof_buffer_length:0
  aof_rewrite_buffer_length:0
  aof_pending_bio_fsync:0
  aof_delayed_fsync:0
  
  # Stats
  total_connections_received:21174
  total_commands_processed:339098
  instantaneous_ops_per_sec:10
  total_net_input_bytes:34329347
  total_net_output_bytes:11702705
  instantaneous_input_kbps:0.96
  instantaneous_output_kbps:0.14
  rejected_connections:0
  sync_full:0
  sync_partial_ok:0
  sync_partial_err:0
  expired_keys:24
  evicted_keys:0
  keyspace_hits:200
  keyspace_misses:84628
  pubsub_channels:0
  pubsub_patterns:0
  latest_fork_usec:0
  migrate_cached_sockets:0
  
  # Replication
  role:master
  connected_slaves:0
  master_repl_offset:0
  repl_backlog_active:0
  repl_backlog_size:1048576
  repl_backlog_first_byte_offset:0
  repl_backlog_histlen:0
  
  # CPU
  used_cpu_sys:27.75
  used_cpu_user:21.72
  used_cpu_sys_children:0.00
  used_cpu_user_children:0.00
  
  # Cluster
  cluster_enabled:0
  
  # Keyspace
  db0:keys=47,expires=47,avg_ttl=17584379
  </code></pre>
  
  <p>And just when it restarts:</p>
  
  <pre><code># Server
  redis_version:3.2.0
  redis_git_sha1:00000000
  redis_git_dirty:0
  redis_build_id:5382f69a4e75566b
  redis_mode:standalone
  os:Linux 3.16.0-4-amd64 x86_64
  arch_bits:64
  multiplexing_api:epoll
  gcc_version:4.9.2
  process_id:1
  run_id:4e22b73f22436677376b4d097746c2a30ba2b9bc
  tcp_port:6379
  uptime_in_seconds:21140
  uptime_in_days:0
  hz:10
  lru_clock:6816977
  executable:/data/redis-server
  config_file:
  
  # Clients
  connected_clients:5
  client_longest_output_list:0
  client_biggest_input_buf:0
  blocked_clients:0
  
  # Memory
  used_memory:33392560
  used_memory_human:31.85M
  used_memory_rss:125399040
  used_memory_rss_human:119.59M
  used_memory_peak:33473544
  used_memory_peak_human:31.92M
  total_system_memory:1787236352
  total_system_memory_human:1.66G
  used_memory_lua:67447808
  used_memory_lua_human:64.32M
  maxmemory:134217728
  maxmemory_human:128.00M
  maxmemory_policy:noeviction
  mem_fragmentation_ratio:3.76
  mem_allocator:jemalloc-4.0.3
  
  # Persistence
  loading:0
  rdb_changes_since_last_save:162
  rdb_bgsave_in_progress:0
  rdb_last_save_time:1466413629
  rdb_last_bgsave_status:ok
  rdb_last_bgsave_time_sec:-1
  rdb_current_bgsave_time_sec:-1
  aof_enabled:1
  aof_rewrite_in_progress:0
  aof_rewrite_scheduled:0
  aof_last_rewrite_time_sec:-1
  aof_current_rewrite_time_sec:-1
  aof_last_bgrewrite_status:ok
  aof_last_write_status:ok
  aof_current_size:1039856
  aof_base_size:0
  aof_pending_rewrite:0
  aof_buffer_length:0
  aof_rewrite_buffer_length:0
  aof_pending_bio_fsync:0
  aof_delayed_fsync:0
  
  # Stats
  total_connections_received:21174
  total_commands_processed:339098
  instantaneous_ops_per_sec:10
  total_net_input_bytes:34329347
  total_net_output_bytes:11702705
  instantaneous_input_kbps:0.96
  instantaneous_output_kbps:0.14
  rejected_connections:0
  sync_full:0
  sync_partial_ok:0
  sync_partial_err:0
  expired_keys:24
  evicted_keys:0
  keyspace_hits:200
  keyspace_misses:84628
  pubsub_channels:0
  pubsub_patterns:0
  latest_fork_usec:0
  migrate_cached_sockets:0
  
  # Replication
  role:master
  connected_slaves:0
  master_repl_offset:0
  repl_backlog_active:0
  repl_backlog_size:1048576
  repl_backlog_first_byte_offset:0
  repl_backlog_histlen:0
  
  # CPU
  used_cpu_sys:27.75
  used_cpu_user:21.72
  used_cpu_sys_children:0.00
  used_cpu_user_children:0.00
  
  # Cluster
  cluster_enabled:0
  
  # Keyspace
  db0:keys=47,expires=47,avg_ttl=17584379
  </code></pre>