mirror of
https://github.com/redis/redis.git
synced 2026-04-22 19:37:30 -04:00
During RDB saving and AOF rewriting, the fork child already dismisses (madvise(MADV_DONTNEED)) individual key-value objects after serializing them. However, the hash table bucket arrays of each dict were never dismissed, leaving large contiguous allocations subject to CoW when the parent modifies them. This PR extends the dismiss mechanism to cover dict bucket arrays, reducing CoW memory overhead. - **Expires kvstore** — dismissed upfront before saving starts, since the child never accesses expires directly, after embeding expire time in the key object. - **Slot dicts** (cluster mode) — dismissed per-slot as the iterator moves to the next slot during RDB saving or AOF rewriting. - **DB keys kvstore** (standalone mode) — dismissed per-DB after each DB is fully serialized during RDB saving or AOF rewriting.