6.3. Active Memory Expansion (AME)
With Active Memory Expansion (AME), pages of main memory that are currently not in use are compressed so that they take up less space. If, for example, 10 GB of main memory is reduced with a compression rate of 2 to 5 GB, this means that significant amount of physical memory can be saved. An LPAR can then either be configured with correspondingly less physical memory (smaller value of desired_mem), or the LPAR can do more work with the same physical memory size. Compressing (and decompressing) memory requires CPU resources. The additional memory gained, must in principle be paid for with CPU resources used for the compression. The compression and decompression must be performed by the operating system. So far, AME is only supported by AIX.
Figure 6.6 shows how AME works. The memory is divided into two pools, the pool of uncompressed memory pages (uncompressed pool) and the pool of compressed memory pages (compressed pool). The figure shows a compression rate of 1.75. This means that 14 GB of data can be compressed to 8 GB at a compression rate of 1.75. This means that 4 GB + 14 GB = 18 GB of data are actually stored in 12 GB of physical memory. This corresponds to a memory expansion by a factor of 1.5.
The sizes of the two pools are not fixed; they depend on the memory utilization and the access pattern to the memory pages. In figure 6.6, only one moment in time is recorded, in the next moment the situation can look slightly different. The access of processes to compressed memory pages is not possible and also makes no sense, since the data is no longer available in the way the process saved it. If a process accesses data that has been compressed in the compressed pool, the operating system must first decompress it and store it in the uncompressed pool. Compressed memory pages cannot be paged out to a paging space.
AME can be activated or deactivated individually for each LPAR, but not dynamically. If AME is to be used for an LPAR, the so-called AME factor must be specified. This indicates the factor by which the actual memory should be expanded. The compression rate required for this is higher because the uncompressed pool remains uncompressed. In the picture above the compression rate was e.g. 1.75 and the achieved AME factor 1.5. A part of the memory must always remain uncompressed, otherwise the operating system can no longer work.
How well AME actually works in practice, depends very much on several factors:
- How well can the data be compressed, i.e. what compression rate can actually be achieved?
- After what time will data be accessed that has been compressed?
- Does the working set of memory pages fit into the uncompressed pool that results after less frequently used data has been compressed?