{
  "id": "database/redis-maxmemory-policy-eviction-blocked",
  "signature": "redis.exceptions.ResponseError: -OOM command not allowed when used memory > 'maxmemory'.",
  "signature_zh": "redis.exceptions.ResponseError：-OOM 命令不允许，当已用内存超过 'maxmemory' 时。",
  "regex": "OOM command not allowed when used memory > 'maxmemory'",
  "domain": "database",
  "category": "resource_error",
  "subcategory": null,
  "root_cause": "Redis has reached its maxmemory limit and the configured eviction policy (maxmemory-policy) cannot free enough space, or the policy is set to 'noeviction', causing write commands to be rejected.",
  "root_cause_type": "generic",
  "root_cause_zh": "Redis 已达到 maxmemory 限制，并且配置的逐出策略 (maxmemory-policy) 无法释放足够的空间，或者策略设置为 'noeviction'，导致写命令被拒绝。",
  "versions": [
    {
      "version": "Redis 6.2",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Redis 7.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Redis 7.2",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Increase maxmemory without addressing the eviction policy or data growth pattern",
      "why_fails": "Memory will eventually fill up again if the root cause (e.g., unbounded cache growth, no eviction) is not fixed.",
      "fail_rate": 0.8,
      "condition": "",
      "sources": []
    },
    {
      "action": "Flush all keys using FLUSHALL or FLUSHDB without restarting or changing config",
      "why_fails": "While this temporarily frees memory, the same pattern of writes will cause the error to recur unless the eviction policy is adjusted.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Set an appropriate eviction policy: CONFIG SET maxmemory-policy allkeys-lru (or volatile-lru, allkeys-lfu, etc.) via redis-cli. Then verify with CONFIG GET maxmemory-policy.",
      "success_rate": 0.9,
      "how": "Set an appropriate eviction policy: CONFIG SET maxmemory-policy allkeys-lru (or volatile-lru, allkeys-lfu, etc.) via redis-cli. Then verify with CONFIG GET maxmemory-policy.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Increase maxmemory if feasible: CONFIG SET maxmemory 2gb (or edit redis.conf and restart). Also monitor memory usage with INFO memory to ensure the new limit is sufficient.",
      "success_rate": 0.8,
      "how": "Increase maxmemory if feasible: CONFIG SET maxmemory 2gb (or edit redis.conf and restart). Also monitor memory usage with INFO memory to ensure the new limit is sufficient.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Set an appropriate eviction policy: CONFIG SET maxmemory-policy allkeys-lru (or volatile-lru, allkeys-lfu, etc.) via redis-cli. Then verify with CONFIG GET maxmemory-policy.",
    "Increase maxmemory if feasible: CONFIG SET maxmemory 2gb (or edit redis.conf and restart). Also monitor memory usage with INFO memory to ensure the new limit is sufficient."
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://redis.io/docs/latest/operate/oss_and_stack/management/admin/#maxmemory",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.9,
  "fix_success_rate": 0.85,
  "resolvable": "true",
  "first_seen": "2023-11-05",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}