当前位置:网站首页>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
边栏推荐
- Dictionary & lt; T1,T2> Sorting problem
- 内网渗透系列:内网隧道之dnscat2
- C # use laida criterion (3) σ Criteria) reject abnormal data (.Net reject singular values in a group of data)
- 大学学习路线规划建议贴
- Unity获取真实地理地图应用Terrain笔记
- 第四章 无形资产
- Unity 获取一个资源被那些资源引用
- About USB flash drive data prompt raw, need to format, data recovery notes
- 索引被锁数据无法写入ES问题处理
- webflux文件上传下载
猜你喜欢
Dictionary & lt; T1,T2> Sorting problem
Houdini > variable building roads, learning process notes
Towords Open World Object Detection
Unity获取真实地理地图应用Terrain笔记
TA notes of Zhuang understand (VII) < Lambert + Phong + shadow + 3evcolor + Ao >
随笔(不定时更新)
Houdini terrain and fluid solution (simulated debris flow)
Houdini>刚体, 刚体破碎RBD
MySQL in window10 version does not work after setting remote access permission
Chapter IV intangible assets
随机推荐
Houdini>建筑道路可变,学习过程笔记
《内网安全攻防:渗透测试实战指南》读书笔记(八):权限维持分析及防御
SAP STO With Billing流程与配置
Unity C# 单例模式 学习复习笔记
Houdini > rigid body, rigid body breaking RBD
Teach-Repeat-Replan: A Complete and Robust System for Aggressive Flight in Complex Environments
Scrapy modifies the time in the statistics at the end of the crawler as the current system time
MySQL8. 0 installation / uninstallation tutorial [window10 version]
Chapter VII asset impairment
一些靶场的学习记录:sqli-labs、upload-labs、XSS
BUUCTF MISC刷题
Zhuang understand's TA notes (VI) < fakeenvreflect & rust, rust effect >
Quick sort
ABAP ALV显示金额与导出金额不一致
Index locked data cannot be written to es problem handling
Encapsulate the debug function of unity
Houdini流体>>粒子流体导出到unity笔记
Link to some good tutorials or notes about network security and record them
Enterprise wechat login free jump self built application
VBA调用SAP RFC实现数据读取&写入