-
Notifications
You must be signed in to change notification settings - Fork 23.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
create a key succeed by INCR command,but it's LFU is not initial value 5. #4926
Comments
Redis creates shared objects including integer 0-9999. |
Yes, and if you wanna use accurate LFU, please config set maxmemory-policy *-lfu. |
i have already configed maxmemory-policy allkes-lfu and maxmemory 1G. 127.0.0.1:4001> config get maxmemory-policy
In my point, there is not LFU(on/off) check in createStringObjectFromLongLong. |
so we can see redis how to create the shared integer objects from
so,I think if you set |
if o doesn't exist,INCR command can create a key by createStringObjectFromLongLong. |
It is a bug, and i open a PR to fix this problem.#5011 |
@shenlongxing I think the purpose of algorithm of evicting is eliminating extra memory, the pr will create more object,and run algorithm to evict it.so I think it's waste of memory,if it's share object,it should exist all the time. |
@ccqy66 I do not agree. |
@antirez It's a bug in my point. What do you think? |
127.0.0.1:4001> incr key
(integer) 1
127.0.0.1:4001> object freq key
(integer) 0
127.0.0.1:4001> incr key
(integer) 2
127.0.0.1:4001> object freq key
(integer) 1
127.0.0.1:4001> set key2 1
OK
127.0.0.1:4001> object freq key2
(integer) 5
The text was updated successfully, but these errors were encountered: