A very fast algorithm for RAM compression

Compressed virtual memory systems have been suggested, and in some cases implemented, to improve the effectiveness of use of physical RAM. However, most proposals and/or implementations are based on adaptive compression algorithms which achieve good compression ratios, but are slow compared to a local disk. Hence, they can only give some advantage with very slow (e.g. network-mounted) swap devices. In this paper we show that in many cases memory pages contain highly compressible data, with a very large amount of zero-valued elements. This suggests the replacement of slow, adaptive compression algorithms with very fast ones based on static Huffman codes.We present one such algorithm which, paired with a careful layout of the data, is able to compress 4KB pages at 40MB/s even when implemented in software on an inexpensive Pentium 100 system. We also show that the algorithm can achieve interesting compression ratios despite its simplicity.Since the compression/decompression speed of our algorithms exceeds disk bandwidth, its use in a compressed VM system can lead to both memory savings and speed improvements in servicing page faults. In this paper we discuss some possible applications of the algorithm in a compressed VM system.

[1]  Stephen Rago,et al.  The Desktop File System , 1994, USENIX Summer.

[2]  Fred Douglis,et al.  The Compression Cache: Using On-line Compression to Extend Physical Memory , 1993, USENIX Winter.

[3]  Andrew Wolfe,et al.  Executing compressed programs on an embedded RISC architecture , 1992, MICRO.

[4]  Liam Goudge,et al.  Embedded control problems, Thumb, and the ARM7TDMI , 1995, IEEE Micro.

[5]  M. Kozuch,et al.  Compression of embedded system programs , 1994, Proceedings 1994 IEEE International Conference on Computer Design: VLSI in Computers and Processors.

[6]  Andrew W. Appel,et al.  Virtual memory primitives for user programs , 1991, ASPLOS IV.

[7]  Mark Taunton,et al.  Compressed Executables: An Exercise in Thinking Small , 1991, USENIX Summer.

[8]  Abraham Lempel,et al.  A universal algorithm for sequential data compression , 1977, IEEE Trans. Inf. Theory.

[9]  Mark Stemm,et al.  Investigating Virtual Memory Compression on Portable Architectures , 1995 .

[10]  Ross N. Williams,et al.  An extremely fast Ziv-Lempel data compression algorithm , 1991, [1991] Proceedings. Data Compression Conference.