Madelyn Olson 2bb29e4aa3
Always compact nodes in stream listpacks after creating new nodes (#11885)
This change attempts to alleviate a minor memory usage degradation for Redis 6.2 and onwards when using rather large objects (~2k) in streams. Introduced in #6281, we pre-allocate the head nodes of a stream to be 4kb, to limit the amount of unnecessary initial reallocations that are done. However, if we only ever allocate one object because 2 objects exceeds the max_stream_entry_size, we never actually shrink it to fit the single item. This can lead to a lot of excessive memory usage. For smaller item sizes this becomes less of an issue, as the overhead decreases as the items become smaller in size.

This commit also changes the MEMORY USAGE of streams, since it was reporting the lpBytes instead of the allocated size. This introduced an observability issue when diagnosing the memory issue, since Redis reported the same amount of used bytes pre and post change, even though the new implementation allocated more memory.
2023-03-07 15:06:53 -08:00
..
2022-11-23 17:39:08 +02:00
2022-08-22 15:01:40 +08:00
2022-08-22 15:01:40 +08:00
2023-02-12 09:23:29 +02:00
2023-02-12 09:23:29 +02:00
2020-04-24 17:11:21 -07:00
2023-01-11 09:59:24 +01:00
2022-11-09 19:50:07 +02:00
2022-11-09 19:50:07 +02:00
2022-03-09 13:58:23 +02:00
2020-05-05 23:35:08 -04:00
2022-08-23 12:37:56 +03:00
2022-04-17 15:43:22 +03:00
2023-01-11 09:59:24 +01:00
2022-10-02 13:56:45 +03:00
2023-02-12 09:23:29 +02:00
2022-08-23 12:37:56 +03:00
2023-02-12 09:23:29 +02:00
2023-02-12 09:23:29 +02:00
2021-07-10 10:04:54 -05:00
2022-07-18 10:56:26 +03:00
2023-01-22 16:32:20 +02:00
2023-02-12 09:23:29 +02:00