From Infogalactic: the planetary knowledge core
(Redirected from ZRam)
Jump to: navigation, search
Written in C
Operating system Linux
Type Linux kernel features
License GNU General Public License
Website kernel.org

zram (also called zRAM and, initially, 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 zram is an alternative way to provide swapping on RAM, zram allows Linux to make a better use of RAM when swapping/paging is required, especially on older computers with less RAM installed.[1][2]

Even when the cost of RAM is low, zram still offers advantages for low-end hardware devices such as embedded devices and netbooks. Such devices usually use flash-based storage, which has limited lifespan due to write amplification, and also use it to provide swap space. The reduction in swap usage as a result of using zram effectively reduces the amount of wear placed on such flash-based storage, resulting in prolonging its usable life. 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 March 30, 2014.[5] As of Linux kernel version 3.15, released on June 8, 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 since 2013[7] and in Android since its version 4.4.[8] Lubuntu also started using zram in its version 13.10.[9] As of December 2012,[needs update?] Ubuntu has considered enabling zram by default on computers with small amounts of installed RAM.[10]

See also


  1. "Increased performance in Linux with zram (virtual swap compressed in ram)". webupd8.org. October 2, 2011. Retrieved November 8, 2011.<templatestyles src="Module:Citation/CS1/styles.css"></templatestyles>
  2. "compcache Compressed Caching for Linux". code.google.com. April 27, 2010. Retrieved November 11, 2011.<templatestyles src="Module:Citation/CS1/styles.css"></templatestyles>
  3. "ZRAM Might Finally Be Moved Out Of Linux Staging". Phoronix. August 14, 2013. Retrieved February 9, 2014.<templatestyles src="Module:Citation/CS1/styles.css"></templatestyles>
  4. "zRAM Is Still Hoping For A Promotion". Phoronix. November 25, 2013. Retrieved February 9, 2014.<templatestyles src="Module:Citation/CS1/styles.css"></templatestyles>
  5. "Linux kernel 3.14, Section 1.2. zram: Memory compression mechanism considered stable". kernelnewbies.org. March 30, 2014. Retrieved April 1, 2014.<templatestyles src="Module:Citation/CS1/styles.css"></templatestyles>
  6. "Linux kernel 3.15, Section 1.7. zram: LZ4 compression support, improved performance". kernelnewbies.org. June 8, 2014. Retrieved June 15, 2014.<templatestyles src="Module:Citation/CS1/styles.css"></templatestyles>
  7. Larabel, Michael (March 28, 2013). "Google is Enabling zram for Chrome OS By Default". chromestory.com. Retrieved March 29, 2013.<templatestyles src="Module:Citation/CS1/styles.css"></templatestyles>
  8. Google, Android KitKat | Android Developers
  9. "Next Lubuntu provided with zram enabled! – LinuxVillage (en)". linuxvillage.org. October 17, 2013. Retrieved November 10, 2013.<templatestyles src="Module:Citation/CS1/styles.css"></templatestyles>
  10. Dinsan, Francis (December 8, 2012). "Ubuntu Linux Considers Greater Usage of zRAM". Retrieved October 30, 2013.<templatestyles src="Module:Citation/CS1/styles.css"></templatestyles>

External links