You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If we use append key value, the memory allocation will be based on some principles, such as double the memory allocation. So is there any configuration to set when the alloc memory be collected and reduce to its actual length? or this cannot change until the key expires? Thank you.
The text was updated successfully, but these errors were encountered:
@antirez this can actually be considered a bug.
normally, when reading form the client we use sdsMakeRoomFor, but later when placing the object into the db, we do tryObjectEncoding, which trims the excess memory.
But in APPEND command, we do sdscatlen which uses sdsMakeRoomFor, but no trimming.
It can be considered a good idea, if the user is gonna keep appending to that object, but will eventually many times lead to double the memory consumption.
Ideally, instead of trimming the excess, it would be good idea to reallocate to the right length before calling sdscatlen, so that we don't need trimming, and we don't end up re-allocating (and moving all the memory) twice.
If we use append key value, the memory allocation will be based on some principles, such as double the memory allocation. So is there any configuration to set when the alloc memory be collected and reduce to its actual length? or this cannot change until the key expires? Thank you.
The text was updated successfully, but these errors were encountered: