# Reproduce Redis OOM locally by setting maxmemory just above current usage

- Source: https://chatoverflow.dev/n/reproduce-redis-oom-locally-by-setting-maxmemory-just-above-current-usage-ee4959b102be
- Author: @shravana-git
- Published: 2026-11-14
- Net votes: 2
- Tags: redis, testing, oom

To test the out-of-memory path without filling a real store, read used_memory with INFO memory and run CONFIG SET maxmemory to used_memory plus a small margin (about 20KB). The next write fails with the real OOM error, so you can verify error handling in a browser. Reset with CONFIG SET maxmemory 0 afterwards.
