IBM Support

Memory allocation difference on VMX-enabled machines

Troubleshooting


Problem

When running applications on VMX-enabled machines (i.e. POWER6, PowerPC 970, POWER7), memory allocation seems to use more memory space than on non-VMX-enabled machines.

Cause

This issue is related to memory alignment boundaries. When you use a 'new' operator on non-VMX-enabled machines, the standard malloc function aligns memory on 8-byte boundaries. This approach does not work on VMX-enabled machines, because VMX instructions require memory to be 16-byte aligned.

Instead of using the standard malloc function, in 32-bit mode the XL C++ Runtime uses the posix_memalign function for the 'new' operator to allocate memory that is on a 16-byte alignment. This alignment can cause a larger memory footprint because the memory is less closely packed. This can cause issues with some applications, particularly those whose memory usage is reaching the process memory limit.

Resolving The Problem

The June 2008 IBM XL C++ Runtime PTF, and later, resolve this issue with an environment variable. To disable the 16-byte alignment on hardware with a VMX unit, the environment variable LIBCPP_NOVMX must be defined and set to 1. Users must ensure that no VMX instructions are used in their application when using this environment variable, because VMX behavior is undefined with non-16-byte aligned memory.

As an alternative solution to disabling the 16-byte alignment explained above, improvements have been made to the posix_memalign implementation that reduce the memory footprint of the 16-byte aligned memory. This improvement aligns memory on 16-byte boundaries with a lower overhead, so that VMX instructions are valid, though applications that are very close to the 32-bit memory limit may still exhibit problems. These improvements are available in the following AIX APARs and versions:

   AIX 5.3 - 5300-12:                  IZ68755


   AIX 6.1 - 6100-05:                  IZ68845
   AIX 7.1 - 7100-00:                  Base Version

[{"Product":{"code":"SSJT9L","label":"XL C\/C++"},"Business Unit":{"code":"BU054","label":"Systems w\/TPS"},"Component":"C\/C++ Runtime","Platform":[{"code":"PF002","label":"AIX"}],"Version":"9.0;10.1;11.1","Edition":"Enterprise Edition","Line of Business":{"code":"LOB08","label":"Cognitive Systems"}},{"Product":{"code":"SSGH3R","label":"XL C\/C++ for AIX"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Component":"C\/C++ Runtime","Platform":[{"code":"PF002","label":"AIX"}],"Version":"9.0;10.1;11.1","Edition":"Enterprise","Line of Business":{"code":"LOB57","label":"Power"}}]

Document Information

Modified date:
06 December 2018

UID

swg21390995