zram
This article is about the Linux kernel feature.
For the memory hardware technology, see
Z-RAM.
For the Linux kernel compressed swap cache, see
zswap.
zram (also referred to as zRAM and previously called compcache) is a Linux kernel feature that provides a form of virtual memory compression. zram increases performance by avoiding paging to disk and using a compressed block device in RAM instead, inside which paging takes place until it is necessary to use the swap space on a hard disk drive. Since using RAM is an alternative way to provide swapping on RAM, zram allows Linux to make more use of RAM when swapping/paging is required, especially on older computers with less RAM installed.[1][2]
Despite the cost of RAM being relatively low (as of February 2014), zram still offers advantages for embedded devices, netbooks and similar low-end hardware devices. Such devices usually use flash-based storage which has a limited lifespan due to its nature, so avoiding its usage for providing swap space prevents it from wearing out quickly. Also, using zram results in a significantly reduced I/O for Linux systems that require swapping.[3][4]
zram was merged into the Linux kernel mainline in kernel version 3.14, released on 30 March 2014.[5] As of Linux kernel version 3.15, released on 8 June 2014, zram supports LZ4 compression algorithm, while LZO remains as the default compression backend. Changes in kernel 3.15 also provide performance improvements, as well as the ability to switch the compression algorithm via sysfs.[6]
Google uses zram in Chrome OS and it is also available as an option for Android 4.4 devices.[7][8] Also, Lubuntu started using zram with version 13.10.[9] As of December 2012, Ubuntu considered enabling zram by default on computers with small amounts of installed RAM.[10]
See also
- Linux swap
- Swap partitions on SSDs
- zswap
References
External links
- 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