'''Virtual memory compression''' is a [[memory management]] technique that utilizes [[data compression]] to reduce the size or number of [[paging]] requests to/from [[auxiliary memory]]. VirtualIn a virtual memory compression issystem, distinctpaging fromrequests are compressed and stored in [[garbageprimary collectionstorage]] systems(usually which[[RAM]]) removeor unusedsent memoryas blockscompressed andto inauxiliary somestorage. In both cases consolidatethe usedoriginal memory regionsis andmarked reduceaccessible. fragmentationThe formemory efficiency.footprint of Virtualthe memory being paged is reduced by the compression process; and, In the first instance, the freed memory is alsoreturned distinctto fromthe [[contextgeneral switching]]memory systemspool, suchwhile asthe Connectix’scompressed portion is kept in RAM; in the second, the compressed data is sent to auxiliary storage but the resulting I/O operation is Doublersmaller and Applethus OStakes 7less time.1, Attempts to access a compressed page result in whicha inactivereversal processesof arethe suspendedprocess—the compressed data is optionally retrieved from auxiliary storage, and then compresseddecompressed.<ref name="PAT-5559978"/><ref name="PAT-5785474"/>
In a virtual memory compression system, paging requests are compressed and stored in [[primary storage]] (usually [[RAM]]) or sent as compressed to auxiliary storage. In both cases the original memory is marked accessible. The memory footprint of the memory being paged is reduced by the compression process; and, In the first instance, the freed memory is returned to the general memory pool, while the compressed portion is kept in RAM; in the second, the compressed data is sent to auxiliary storage but the resulting I/O operation is smaller and thus takes less time. Attempts to access a compressed page result in a reversal of the process—the compressed data is optionally retrieved from auxiliary storage, and then decompressed.
In some implementations such as in [[zswap]], [[zram]] and [[Helix Software Company]]’s Hurricane, the entire process is managed by the operating system. In other systems such as IBM’s MXT, the compression process occurs in a dedicated processor which handles transfers between a local cache and primary storage.
Virtual memory compression is distinct from [[garbage collection]] systems which remove unused memory blocks and in some cases consolidate used memory regions and reduce fragmentation for efficiency. Virtual memory compression is also distinct from [[context switching]] systems, such as Connectix’s RAM Doubler and Apple OS 7.1, in which inactive processes are suspended and then compressed.<ref name="PAT-5559978"/><ref name="PAT-5785474"/>