Redis使用问题一
Reid 使用指南一 问题一 OOM command not allowed when used memory > ‘maxmemory’ 这里表示使用内存超过了设置的最大内存。 redis.conf中的maxmemory定义REdis可用最大物理内存,有多种书写方式,以下均为合法: maxmemory 1048576 maxmemory 1048576B maxmemory 1000KB maxmemory 100MB maxmemory 1GB maxmemory 1000K maxmemory 100M maxmemory 1G 没有带单位尾巴的为字节数,以B结尾的表示相应的大小。但需要注意KB和K、MB和M、GB和G是不同的,如1K表示1000字节,而1KB则为1024字节。如果maxmemory值为0,表示不做限制。 如果是32位系统,当maxmemory值为0时,redis启动时会记录WARN日志 Warning: 32 bit instance detected but no memory limit set. Setting 3 GB maxmemory limit with ’noeviction’ policy now. server.maxmemory = 3072LL_(1024_1024); /* 3 GB */ server.maxmemory_policy = MAXMEMORY_NO_EVICTION; 相关的源代码如下: /* Convert a string representing an amount of memory into the number of ...