Skip to content

Commit

Permalink
Update MEMORY USAGE examples to latest version (#2450)
Browse files Browse the repository at this point in the history
  • Loading branch information
enjoy-binbin authored Jun 28, 2023
1 parent 9a1f959 commit 957185e
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions commands/memory-usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,29 +10,32 @@ By default, this option is set to `5`. To sample the all of the nested values, u

@examples

With Redis v4.0.1 64-bit and **jemalloc**, the empty string measures as follows:
With Redis v7.2.0 64-bit and **jemalloc**, the empty string measures as follows:

```
> SET "" ""
OK
> MEMORY USAGE ""
(integer) 51
(integer) 56
```

These bytes are pure overhead at the moment as no actual data is stored, and are
used for maintaining the internal data structures of the server. Longer keys and
used for maintaining the internal data structures of the server (include internal allocator fragmentation). Longer keys and
values show asymptotically linear usage.

```
> SET foo bar
OK
> MEMORY USAGE foo
(integer) 54
> SET cento 01234567890123456789012345678901234567890123
45678901234567890123456789012345678901234567890123456789
(integer) 56
> SET foo2 mybar
OK
127.0.0.1:6379> MEMORY USAGE cento
(integer) 153
> MEMORY USAGE foo2
(integer) 64
> SET foo3 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789
OK
> MEMORY USAGE foo3
(integer) 160
```

@return
Expand Down

0 comments on commit 957185e

Please sign in to comment.