当前位置:网站首页>Redis--为什么字符串emstr的字符串长度是44字节上限?
Redis--为什么字符串emstr的字符串长度是44字节上限?
2022-04-23 06:30:00 【梦江河梦】
redis对象的结构
一个这样的结构体占用16字节
string对象的结构体
1)string编码第一种–64位有符号整数
2)string编码第二种–embstr
3)string编码第三种–raw
这种结构需要内存分配两次,一次分配16字节的redis对象结构体,一次分配sds对象,sds是动态扩容的,策略是:字符串在长度小于 1M 之前,扩容空间采用加倍策略,也就是保留 100% 的冗余空
间。当长度超过 1M 之后,为了避免加倍后的冗余空间过大而导致浪费,每次扩容只会多分配 1M 大小的冗余空间。
版权声明
本文为[梦江河梦]所创,转载请带上原文链接,感谢
https://blog.csdn.net/weixin_42002747/article/details/124079980
边栏推荐
- Enterprise wechat login free jump self built application
- Houdini地形与流体解算(模拟泥石流)
- Electronic builder package error: proxyconnect TCP: Dial TCP: 0: connectex
- Robust and Efficient Quadrotor Trajectory Generation for Fast Autonomous Flight
- Use of command line parameter passing library argparse
- TA notes of Zhuang understand (zero) < bedding and learning methods >
- How does Apache Hudi accelerate traditional batch mode?
- strcat()、strcpy()、strcmp()、strlen()
- KCD_EXCEL_OLE_TO_INT_CONVERT报错SY-subrc = 2
- Nodejs (VI) sub process operation
猜你喜欢
How does Apache Hudi accelerate traditional batch mode?
Houdini > variable building roads, learning process notes
内网渗透系列:内网隧道之icmp_tran
Protobuf use
Houdini terrain and fluid solution (simulated debris flow)
CTF攻防世界刷题51-
C # control the camera, rotate and drag the observation script (similar to scenes observation mode)
Unity C single case mode learning review notes
内网渗透系列:内网隧道之dnscat2
Towords Open World Object Detection
随机推荐
C problem of marking the position of polygons surrounded by multiple rectangles
BUUCTF MISC刷题
Dropping Pixels for Adversarial Robustness
Zhuang understand's TA notes (VI) < fakeenvreflect & rust, rust effect >
内网渗透系列:内网隧道之icmptunnel(DhavalKapil师傅的)
大学学习路线规划建议贴
03use of scanner class (console input)
Intranet penetration series: icmptunnel of Intranet tunnel (by master dhavalkapil)
IT高薪者所具备的人格魅力
05数组的使用
内网渗透系列:内网隧道之icmpsh
Understanding the Role of Individual Units in a Deep Neural Networks(了解各个卷积核在神经网络中的作用)
C # control the camera, rotate and drag the observation script (similar to scenes observation mode)
Unity screen adaptation
Personality charm of high paid it workers
内网渗透系列:内网隧道之icmptunnel(jamesbarlow师傅的)
CTF-MISC学习之从开始到放弃
庄懂的TA笔记(零)<铺垫与学习方法>
Using lambda expression to solve the problem of C file name sorting (whether it is 100 or 11)
Idea shortcut