IBM Support

Active Memory Expansion (AME)

Question & Answer


Question

How do you configure, manage, and monitor the Active Memory Expansion and set the appropriate Expansion Factor?

Cause

The Active Memory Expansion Planning Tool (amepat) is the recommended tool for managing all aspects of the active memory expansion feature.

Operating with active memory expansion may not always be the best choice for certain environments.

Answer


This document explains how to properly enable, configure, and monitor the Active Memory Expansion feature, along with the benefits it offers, potential issues, and how to avoid them.

Active Memory Expansion (AME) definition:
Active Memory Expansion is a feature that allows the operating system's working memory to be expanded, starting from AIX 6.1 TL04 SP02.

How does the Active Memory Expansion work?

It operates using memory compression technology, compressing in-memory data to allow more data to fit into memory. The feature compresses a portion of the LPAR's memory (Compressed Pool) while leaving the rest of the memory uncompressed (Uncompressed Pool).


How do you check if your system is capable of Active Memory Expansion?
image-20250311135850-1

To enable AME, you first need to verify if the managed system supports Active Memory Expansion.

  1. From the Hardware Management Console, select the managed system you want to check.
  2. Open the 'Properties' for the selected system.
  3. Go to the 'Capabilities' tab.
  4. Look for the entry "Active Memory Expansion Capable."
  5. If it shows "True", the system supports Active Memory Expansion.

There are no limits on the number of logical partitions that can use AME within a system. You can enable AME for a specific partition while leaving others disabled.

Active Memory Expansion requires a charge for permanent enablement per managed system, or you can opt for a 60-day trial via Capacity on Demand to test in your environment.

The screenshot above shows a system that is not capable of supporting Active Memory Expansion.


How do you activate the Active Memory Expansion (AME)?

Active Memory Expansion (AME) should be activated through the Hardware Management Console.

  1. To enable AME for an LPAR, edit the partition's profile.
  2. Navigate to the Memory tab.
  3. Look for the "Activate Memory Expansion" option.
  4. Check the box to enable AME.
  5. You can also specify the active memory expansion factor in the provided text box.

A hard reboot is required to complete the activation of AME. This involves shutting down the LPAR and then restarting it through the Hardware Management Console to apply the changes made to the LPAR's profile.

Once the logical partition is back up, AME will become enabled. To confirm, use the command lparstat -i, which will display "Memory Mode: Dedicated-Expanded."


What is the expansion factor?
The expansion factor determines how much the true memory will be multiplied: Expanded Memory = True Memory × Expansion Factor

The expansion factor can range from 1.00 to 10.00. 

Setting the expansion factor to 1.00 is not recommended, as it will not result in any memory expansion. Additionally, a factor of 10.00 has not been commonly used.

You can adjust the expansion factor using the dynamic logical partitioning (DLPAR) feature. Through DLPAR, you can modify the expansion factor when adding or removing memory.


Changing the AME expansion factor

To dynamically adjust the Active Memory Expansion factor for a logical partition, follow these steps using the HMC:

  1. In the navigation pane, go to Systems Management > Servers and select the managed system where the logical partition is located.
  2. In the contents pane, choose the logical partition for which you want to change the Active Memory Expansion factor.
  3. From the Tasks menu, select Dynamic Partitioning > Memory > Add or Remove. This will open the Add/Remove Memory Resources window.
  4. In the Active Memory Expansion field, enter a value between 1.00 and 10.00.
  5. Click OK to apply the changes.

How to configure the partition to work with active memory expansion?

The Active Memory Expansion Planning Tool is required to complete the configuration. This tool can also be used later to assess the performance of Active Memory Expansion. It recommends the optimal expansion factor for the partition to handle peak workload times effectively.


The Active Memory Expansion Planning Tool functions:

The Active Memory Expansion Planning Tool, known as amepat, performs several key functions:

  • It scans current memory usage to determine if a workload could benefit from the AME feature.
  • It provides a list of possible expansion configurations for the workload.
  • It records expected CPU utilization for each expansion factor.
  • It aims to maximize memory savings while minimizing additional CPU usage.
  • It monitors and analyzes system configuration, workload, and performance statistics with AME.
  • It logs system configurations and various performance statistics into a file.
  • It generates workload utilization and planning reports.

amepat can be executed on both partitions with AME enabled or disabled. If AME is disabled, it can suggest an appropriate expansion factor.

This tool is compatible with all IBM Power Systems servers running AIX 6.1 or later.

It helps suggest the best expansion factor based on peak workload times and provides insights into the CPU cycles needed to work with AME. Additionally, it displays detailed memory information, including pinned memory, file cache, virtual memory, and true memory.


Key considerations when running amepat to do workload planning:

The timing and duration for running the tool are important for optimal results.

To achieve the best outcomes, the tool should be run during the peak utilization period of the workload. This ensures that it captures the highest memory usage and utilization data for the workload.

The duration for running the tool should also be taken into account, and we recommend using different time windows. If there is a change in the workload's utilization level during the amepat run, the tool should be executed again to reflect the updated conditions.


The following output from the # amepat 1 1 command shows some statistics:
image-20250311140242-2

The following output is a report generated from amepat from another partition:
image-20250311140557-3

What are the main changes active memory expansion does?
In earlier versions of AIX, Active Memory Expansion disables support for AIX 64 KB pages. However, since AIX 7.2 TL1 on POWER8 servers and later, Active Memory Expansion has supported 64 KB pages.

By default, ame_mpsize_support tunable is set to 0. This value enables legacy behavior in an AME environment, where only the 4 KB and 16 MB page sizes are supported. Setting the value to 1 enables all supported page sizes in an AME environment. This tunable parameter can only be modified on POWER8 or later processor-based servers, which support the 64 KB page size accelerator.

To enable 64 KB pages, you can run the following command:

# vmo -ro ame_mpsize_support=1

Note: This change requires a bosboot and a reboot.


Which memory pages can active memory expansion work on?

Active Memory Expansion can compress memory pages used by applications on the system. However, it will not work for certain memory pages. Specifically, Active Memory Expansion does not compress or apply to the following memory pages:

  • AIX kernel
  • Filesystem cache
  • Pinned memory

Key considerations when using Active Memory Expansion:
The POWER5+ processor supports four virtual memory page sizes: 4 KB, 64 KB, 16 MB, and 16 GB. The 64 KB page size is particularly useful for many applications, offering performance improvements compared to the 4 KB page size. AIX provides strong support for the 64-KB page size.
It's important to confirm whether you actually intend to enable AME. In earlier versions of AIX, enabling Active Memory Expansion would disable support for 64 KB pages. However, since AIX 7.2 TL1 on POWER8 servers, AME supports 64 KB pages.

Use the command # vmstat -P all to check for the presence of different page sizes.

Pinned memory and file cache cannot be compressed, and it's important to note that Active Memory Expansion is not a RAM disk.
The lower the Active Memory Expansion factor, the fewer CPU cycles will be required for AME. Conversely, the higher the expansion factor, the more CPU cycles will be needed for AME. The actual CPU usage for Active Memory Expansion may vary, depending on the workload.
Proper planning for Active Memory Expansion using amepat is essential.
If the compressible memory for the workload is small, the report may not be generated, which can occur in systems with limited memory.
If you've set the appropriate expansion factor and the system is running normally with AME, but there is a change in the workload's utilization, you should rerun amepat. This will suggest a new expansion factor, allowing you to adjust it dynamically based on the updated recommendation.
The Active Memory Expansion feature relies on a daemon called 'cmemd', which compresses and uncompresses memory as needed. This can result in additional processor consumption. If you observe high CPU usage from the cmemd process, it's recommended to contact IBM Support for assistance. Some AIX operating system versions may experience an AME loop during a shrink operation, potentially leading to a system hang.

How do I confirm if the 64K pages are disabled?
Using the vmstat command, run # vmstat -P all
The output displayed will be similar to the following for a system that uses both 4K and 64K pages:
System configuration: mem=98304MB
pgsz            memory                           page                 
----- -------------------------- ------------------------------------ 
           siz      avm      fre    re    pi    po    fr     sr    cy 
   4K 12411296  4353541  7142992     0     0     0     0      0     0 
  64K   797158   782700    14458     0     0     0     0      0     0 

No reason to set the Expansion Factor as 1.0

Setting the Active Memory Expansion factor to 1.0 is not the same as disabling AME. If you need to disable AME, do so through the HMC rather than setting the expansion factor to 1.0.

Even with an expansion factor of 1.0, the system must still maintain two memory pools (compressed and uncompressed), which consumes resources specifically for the Active Memory Expansion mechanism. Additionally, the memory path will be slower if the expansion factor is set to 1.0.

If no AME is required, it is recommended to disable AME immediately rather than set the expansion factor to 1.0.


How to correctly assign the appropriate active memory expansion factor?

Use the amepat tool to determine the appropriate and suggested expansion factor. Run amepat for one hour to record Active Memory Expansion data into the specified recording file.

It is recommended to execute amepat during periods of high workload in your environment. Use the -R flag to record Active Memory Expansion data into the specified file. This recorded data can later be processed using the -P option.

To run amepat in the background for one hour, use the command:
# amepat -R ame.int 60

You will see the message: "Continuing Recording through background process..."

To check if the amepat process is running, use the command:
# ps -ef | grep amepat

The output will be written to the ame.int file, which can be processed later.

We recommend running multiple reports during other high-workload periods. If the workload is low, the report may suggest shrinking the memory.

Once the amepat command completes (typically after one hour or slightly longer), use the command # amepat -P ame.int to process the ame.int file and generate a report.

You can also use the -t flag to specify a target size for modeling instead of relying on the calculated one. For example, if you specify a target size of 4.00 GB in the ame.int file, the tool might recommend increasing the assigned memory to 2.50 GB with an expansion factor of 1.6, which would bring the total memory to 4.00 GB, as specified with the -t flag.


How to monitor your active memory expansion behavior?

You can check Active Memory Expansion (AME) statistics with the command # lparstat -i.

When AME is enabled, the output will show Memory Mode: Dedicated-Expanded. When AME is disabled, it will show Memory Mode: Dedicated.

The Desired Memory represents the true physical memory assigned to the partition. The lparstat -i command also lists the Target Memory Expansion Factor and the Target Memory Expansion Size:

Desired Memory: 32768 MB
Target Memory Expansion Factor: 2.00
Target Memory Expansion Size: 65536 MB (Target = True memory x Expansion factor)

Alternatively, you can use the kdb command: # echo vmstat | kdb | grep -p true_memsizepgs

This will display the following statistics:

true_memsizepgs: 0000000000800000 32.0 GB
ame_memsizepgs:  0000000001000000 64.0 GB
cmem_cpool_size: 00000000177D8A00 375.8 MB
cmem_cpool_free: 000000000403F600 64.2 MB
cmem_tot_ncpgs:  000000000005016A 1.3 GB
cmem_tot_csize:  0000000013799400 311.6 MB
current compression ratio: 0000019B 4.11

You can also use vmstat -c 1 to monitor the following:

  • co: Number of page-outs per second to the compressed pool
  • ci: Number of page-ins per second from the compressed pool
image-20250311141113-4

Use lparstat -c 1 to monitor CPU usage by Active Memory Expansion (AME). The following statistics are shown only when the -c flag is used:

  • %xcpu: Indicates the percentage of CPU utilization dedicated to Active Memory Expansion (AME) relative to the total CPU consumption by the logical partition.
  • xphysc: Displays the number of physical processors being used for the Active Memory Expansion activity.
  • dxm: Shows the size of the expanded memory deficit for the LPAR, measured in MB.
image-20250311141351-5

Use the svmon command with the following syntax:
# svmon -G -O summary=ame -O pgsz=on

The output will display memory usage information, and if no 64K pages are present, it will indicate that.

image-20250311141631-6

You can also use topas to monitor memory statistics:

TMEM: True Memory
CMEM: Compressed Memory
CI: Compressed Page In
CO: Compressed Page Out
EF: Expansion Factor
T: Target
A: Actual

How to disable the Active Memory Expansion?

To disable Active Memory Expansion (AME), follow these steps:

  1. Edit the logical partition profile and open the Memory tab.
  2. Uncheck the box next to 'Activate Memory Expansion.'
  3. Shut down the logical partition.
  4. Reactivate the logical partition from the HMC through its profile.
  5. Confirm that AME is disabled by running the command lparstat -i; the Memory Mode will display as "Dedicated."

Sources for more information:

[{"Product":{"code":"SWG10","label":"AIX"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Component":"Not Applicable","Platform":[{"code":"PF002","label":"AIX"}],"Version":"6.1;7.1","Edition":"","Line of Business":{"code":"LOB08","label":"Cognitive Systems"}}]

Document Information

Modified date:
05 May 2025

UID

isg3T1025141