Infrastructure at your Service

Yann Neuhaus

Huge Pages and AMM is (not) possible with 11.2.0.2!

! Read the last comment posted below, this information has been fixed in between – Huge Pages is definitively not possible with AMM !

Huge Pages were introduced in order to optimize the process of Memory Management on Linux Servers. The scope of this article is not to present in detail this technology, several articles and metalink note did this well (749851.1 – 361323.1 – 401749.1). Running Linux servers configured with Huge Pages was not always adapted when both 10.2 and 11.2 databases had to be started in parallel because the Oracle 11g Automatic Memory Management was not compatible with Huge Pages. This situation changed with Oracle 11.2.0.2!

As mentionned in Kevin Closson’s blog (see below), the 11.2.0.2 release now supports Huge Pages and AMM (Automatic Memory Management) through the setting of the parameters memory_target and memory_max_size.

http://kevinclosson.wordpress.com/2010/09/28/configuring-linux-hugepages-for-oracle-database-is-just-too-difficult-part-i/

Moreover since 11.2.0.2 it is possible to force the usage of Huge Page memory with the parameter use_large_pages=only.
When set to “only” this parameter prevents the instance to start on regular memory if not enough Huge Pages are available.

Per default the parameter is set to true, which means that if Huge Pages are available they will be used. If not enough Huge Pages are available Oracle will fall back to regular memory.

SQL>  show parameter use_large_pages
NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
use_large_pages                      string      TRUE

Since 11.2.0.2, while starting an Oracle instance, we have the following information in the alter.log file confirming that Huge Pages have been used.

Starting ORACLE instance (normal)
****************** Huge Pages Information *****************
Huge Pages memory pool detected (total: 25600 free: 24874)
DFLT Huge Pages allocation successful (allocated: 321)
***********************************************************

The fact that Oracle supports Huge Pages and memory_target (which was not possible in the first 11g releases) confirms that Huge Pages are really advised by Oracle. So keep up to date and take care while reading metalink notes stating that “With AMM all SGA memory is allocated by creating files under /dev/shm. When Oracle DB does SGA allocations that way HugePages are not reserved/used. The use of AMM is absolutely incompatible with HugePages.” – ML note 749851.1

Through this improvement the configuration of Linux Servers running 10.2 and 11.2 in parallel becomes easier, since AMM is no more excluded.
Have fun with Huge Pages !

One Comment

  • Neuhaus says:

    Somehow I performed some additional tests and it seems that memory_target and Huge pages are in fact not really compatible :(. I have the feeling something messed up my last tests, therefore this fix as a comment.

    I force the usage of “huge pages”:

    SQL> alter system set use_large_pages = only scope=spfile;

    System altered.

    Instance configured with memory_target :

    SQL> show parameter memory

    NAME TYPE VALUE
    ———————————— ———– ——————————
    hi_shared_memory_address integer 0
    memory_max_target big integer 700M
    memory_target big integer 700M
    shared_memory_address integer 0

    Restart the instance and check in the alert.log file :

    In the alert.log :

    ******************************************************************
    Huge Pages are not compatible with specified SGA memory parameters
    use_large_pages = “ONLY” cannot be used with memory_target,
    memory_max_target, or use_indirect_data_buffers parameters
    Huge Pages are compatible with sga_target and shared_pool_size
    ******************************************************************

    Indeed, huge pages and memory_target are not compatible.

    However setting the sga_target (500M) and the pga_agreggate_taget (200M) works fine :

    SQL> show parameter sga_target

    NAME TYPE VALUE
    ———————————— ———– ——————————
    sga_target big integer 500M

    SQL> show parameter pga_ag

    NAME TYPE VALUE
    ———————————— ———– ——————————
    pga_aggregate_target big integer 200M

    We force the usage of large pages :

    SQL> show parameter use_large

    NAME TYPE VALUE
    ———————————— ———– ——————————
    use_large_pages string ONLY

    Verify that the reserved huge pages increases and is really used :

    [email protected]:/u00/app/oracle/admin/RCAT/pfile/ [RCAT] grep Huge /proc/meminfo
    HugePages_Total: 750
    HugePages_Free: 573
    HugePages_Rsvd: 74

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Yann Neuhaus
Yann Neuhaus

Vice-chairman of the Board, Chief Sales Officer (CSO), Region Manager
Region Manager