Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
20e10dc7
Commit
20e10dc7
authored
Jun 21, 2018
by
Oran Agra
Browse files
fix streams memory estimation, missing raxSeek
parent
c6fdebf5
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/object.c
View file @
20e10dc7
...
@@ -745,7 +745,7 @@ char *strEncoding(int encoding) {
...
@@ -745,7 +745,7 @@ char *strEncoding(int encoding) {
* size of a radix tree that is used to store Stream IDs.
* size of a radix tree that is used to store Stream IDs.
*
*
* Note: to guess the size of the radix tree is not trivial, so we
* Note: to guess the size of the radix tree is not trivial, so we
* approximate it considering 1
28
bytes of data overhead for each
* approximate it considering 1
6
bytes of data overhead for each
* key (the ID), and then adding the number of bare nodes, plus some
* key (the ID), and then adding the number of bare nodes, plus some
* overhead due by the data and child pointers. This secret recipe
* overhead due by the data and child pointers. This secret recipe
* was obtained by checking the average radix tree created by real
* was obtained by checking the average radix tree created by real
...
@@ -904,6 +904,7 @@ size_t objectComputeSize(robj *o, size_t sample_size) {
...
@@ -904,6 +904,7 @@ size_t objectComputeSize(robj *o, size_t sample_size) {
* structures and the PEL memory usage. */
* structures and the PEL memory usage. */
raxIterator
cri
;
raxIterator
cri
;
raxStart
(
&
cri
,
cg
->
consumers
);
raxStart
(
&
cri
,
cg
->
consumers
);
raxSeek
(
&
cri
,
"^"
,
NULL
,
0
);
while
(
raxNext
(
&
cri
))
{
while
(
raxNext
(
&
cri
))
{
streamConsumer
*
consumer
=
cri
.
data
;
streamConsumer
*
consumer
=
cri
.
data
;
asize
+=
sizeof
(
*
consumer
);
asize
+=
sizeof
(
*
consumer
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment