zram(也称为zRAM,先前称为compcache)是Linux核心的一项功能,可提供虚拟内存压缩。zram通过在RAM内的压缩块设备上分页,直到必须使用硬盘上的交换空间,以避免在磁盘上进行分页,从而提高性能。由于zram可以用内存替代硬盘为系统提供交换空间的功能,zram可以在需要交换/分页时让Linux更好利用RAM,在物理内存较少的旧电脑上尤其如此[1][2]。
即使RAM的价格相对较低(截至2014年2月 (2014-02)[update]),zram仍有利于嵌入式设备、上网本和其它相似的低端硬件设备。这些设备通常使用固态存储,它们由于其固有性质而寿命有限,因而避免以其提供交换空间可防止其迅速磨损。此外,使用zRAM还可显著降低Linux系统用于交换的I/O[3][4]。
zram于3.14合并入Linux内核主线,并于2014年3月30日发布[5]。截至发布于2014年6月8日的Linux内核3.15,zram可支持LZ4压缩算法,而LZO仍然作为默认的压缩后端。内核3.15中的修改还改进了性能,以及经由sysfs切换压缩算法的能力[6]。
Google在Chrome OS中使用zram,它也成为了Android 4.4设备的一个选项[7][8]。此外,Lubuntu于13.10开始使用zram[9]。截至2012年12月 (2012-12)[update],Ubuntu考虑为小内存的计算机默认启用zram[10]。
参见
参考
- ^ Increased performance in Linux with zram (virtual swap compressed in ram). webupd8.org. 2 October 2011 [8 November 2011]. (原始内容存档于2022-02-14).
- ^ compcache Compressed Caching for Linux. code.google.com. 27 April 2010 [11 November 2011]. (原始内容存档于2013-01-17).
- ^ ZRAM Might Finally Be Moved Out Of Linux Staging. Phoronix. 2013-08-14 [2014-02-09]. (原始内容存档于2021-01-26).
- ^ zRAM Is Still Hoping For A Promotion. Phoronix. 2013-11-25 [2014-02-09]. (原始内容存档于2021-03-09).
- ^ Linux kernel 3.14, Section 1.2. zram: Memory compression mechanism considered stable. kernelnewbies.org. 2014-03-30 [2014-04-01]. (原始内容存档于2021-01-15).
- ^ Linux kernel 3.15, Section 1.7. zram: LZ4 compression support, improved performance. kernelnewbies.org. 2014-06-08 [2014-06-15]. (原始内容存档于2018-06-11).
- ^ Larabel, Michael. Google is Enabling zram for Chrome OS By Default. chromestory.com. 28 March 2013 [29 March 2013]. (原始内容存档于2019-11-30).
- ^ Google, Android KitKat | Android Developers (页面存档备份,存于互联网档案馆)
- ^ Next Lubuntu provided with zram enabled! – LinuxVillage (en). linuxvillage.org. 17 October 2013 [10 November 2013]. (原始内容存档于2013年11月10日).
- ^ Dinsan, Francis. Ubuntu Linux Considers Greater Usage of zRAM. 8 December 2012 [30 October 2013]. (原始内容存档于2018-08-30).
外部链接
- Compcache, Compressed Caching for Linux (页面存档备份,存于互联网档案馆)
- Compcache: in-memory compressed swapping (页面存档备份,存于互联网档案馆), May 26, 2009, LWN.net, by Nitin Gupta
- In-kernel memory compression (页面存档备份,存于互联网档案馆), April 3, 2013, LWN.net, by Dan Magenheimer
- The Compression Cache: Virtual Memory Compression for Handheld Computers (页面存档备份,存于互联网档案馆), March 16, 2000, by Michael J. Freedman
|
---|
| 组织 | |
---|
| 技术 | 调试 | - CRIU(英语:CRIU)
- ftrace(英语:ftrace)
- kdump
- Linux内核oops
- SystemTap(英语:SystemTap)
|
---|
| 启动过程 | |
---|
| ABI | |
---|
| API | 用户空间 | |
---|
| 内核部分 | 系统调用接口 | - POSIX
- ioctl
- select
- open
- read
- close
- sync
- ...
- Linux独有
|
---|
| 内核内 | |
---|
|
---|
|
---|
| 内核组件 | - 安全模块:AppArmor
- Exec Shield(英语:Exec Shield)
- grsecurity(英语:grsecurity)
- seccomp(英语:seccomp)
- SELinux
- Smack
- TOMOYO Linux(英语:TOMOYO Linux)
- Linux PAM(英语:Linux PAM)
|
---|
| 变种 | |
---|
|
---|
| 采用 | 使用范围 | - 桌面
- 嵌入式
- 游戏
- 瘦客户端:
- LTSP
- Thinstation(英语:Thinstation)
- 服务器:
- 设备
|
---|
| 采用者 | - Linux采用者列表
- GENIVI联盟
- Linux专有软件
|
---|
|
---|
| 人物 | |
---|
| |
|
|
---|
| - 操作系统的内存管理功能(英语:Memory management (operating systems))
| | 手动内存管理(英语:Manual memory management) | |
---|
| 虚拟内存 | - 按需分页(英语:Demand paging)
- 分頁表
- 分頁
- 虚拟内存压缩(英语:Virtual memory compression)
|
---|
| 硬件内存管理 | |
---|
| 垃圾回收 | |
---|
| 記憶體分段 | |
---|
| 記憶體安全 | |
---|
| 针对的问题 | |
---|
| 其它 | - 自动变量
- 内存管理国际研讨会(英语:International Symposium on Memory Management)
- 基于区域内存管理(英语:Region-based memory management)
|
---|
|
|
---|
| 概述 | - 宣传(英语:Operating system advocacy)
- 比较(英语:Comparison of operating systems)
- 鑑識软件工程(英语:Forensic software engineering)
- 历史
- 爱好者开发(英语:Hobbyist operating system development)
- 列表
- 年表
- 份额
|
---|
| 内核 | |
---|
| 行程管理 | 概念 | |
---|
| 调度算法 | - 多任务处理
- 固定优先级抢占(英语:Fixed-priority pre-emptive scheduling)
- 多级反馈队列(英语:Multilevel feedback queue)
- 抢占式多任务处理
- 循環制
- 短进程优先
|
---|
|
---|
| 記憶體管理和資源保护 | |
---|
| 存储访问和文件系统 | |
---|
| 操作系统列表 | |
---|
| 其他概念 | |
---|
|