1. Field of the Invention
The present invention relates to computer memory architectures and, more particularly, to maintaining an amount of available memory using adaptive compression techniques.
2. Description of the Related Art
Computer memory systems have at least two major problems: there is seldom enough memory and what memory there is tends to be expensive. Unfortunately, high performance computing, e.g. computer gaming, demands large amounts of fast memory. Memory is often the most expensive component of many computer architectures.
One way of reducing the cost of memory is to use data compression techniques. When data is compressed, more information can be stored in a given memory space, which makes the memory appear larger. For example, if 1KB of memory can store 2KB of uncompressed data, the memory appears to be twice as large as it really is. Thus, system cost may be reduced as only half the actual physical memory may be required.
Historically, compression was not been widely used because of difficulties associated with memory space management. For example, a computer that uses compressed memory must accommodate the variable length data that results from the compression. In addition, the computer must have compressed data directories and must include cache areas (working spaces) for uncompressed data. High performance computing represents an additional problem since the latency problems associated with compressing and uncompressing data must be overcome. That is, before compressed data can be used it must be uncompressed, which takes time, and then that data must be recompressed, which takes additional time, before storing. In some applications latency concerns are so severe that data compression historically could not be used. For example, computer gamers demand high speed graphics that operate without latency induced delays, glitches, or other visual defects.
U.S. Pat. No. 5,812,817, issued to Hovis et al. on Sep. 22, 1998, entitled, “Compression Architecture for System Memory Application” teaches useful memory architectures that store both uncompressed and compressed data. Having both types of data is useful since, in practice, most data accesses are to a relatively small amount of the total data. By storing often accessed data in the uncompressed state, and by storing less frequently accessed data in the compressed state, the teachings of U.S. Pat. No. 5,812,817 can significantly reduce latency problems associated with compressed data.
Computer hardware designers can use the teachings of U.S. Pat. No. 5,812,817 to increase the apparent size of memory. By incorporating a memory of a known size, and by incorporating a compression technique having an assumed minimum compression ratio, a hardware designer can inform software designers how much apparent memory they can assume is available. While in most cases an assumed minimum compression ratio is practical, some data simply does not compress well. In fact, some data compresses very little, if at all. Since poorly compressible data is fairly rare it is usually not a serious problem. Unfortunately, in high performance computing such huge amounts of similar data must be processed that when poorly compressed data does occur; there can be a lot of it. So, when poorly compressed data does occur the system memory is in danger of filling up. If the memory fills, data can be lost or data must be offloaded from memory (e.g., to a hard drive or “disk”), often resulting in a significant drop in system performance.
Since hardware designers recognize problems associated with filled memory they can provide hardware flags that signal software that memory might be approaching full. This technique, termed trapping to software, provides the software an opportunity to protect data. In some applications the software can simply store data in alternative memory devices, such as disk, or it can simply dump unneeded data, such as a previous display screen to free up more space. However, in applications such as computer gaming such approaches are usually unacceptable. Storing to disk dramatically increases latency issues while dumping a previous display is not a desirable option, as the display will very likely be required again.
Therefore, techniques of optimizing an amount of apparent memory using adaptive compression techniques would be useful, preferably, that mitigates latency issues.