Large Pages Implementation in Windows

It was pointed out to me that I have not yet covered the steps for configuring hugepages for windows. Hugepages are rarely configured for windows, but it is available, and Oracle does recommending configuring it. Largepage size for windows is 16M. Nwalter Notes in comments below that in at least some windows versions, the registry key ORA_LPSIZE can be used to set the size of the large page granule.

There is a large caveat for largepages on windows. When starting the Oracle instance using hugepages, all of the hugepage memory must be contiguous. This means, for example, if the database, has an sga_target of 20g, there must not just be 20g RAM free, there must be 20g of contiguous RAM free on the server. This may mean that you have to reboot the server every time you want to restart the Oracle database.

So, the steps for largepage/hugepage implementation are as follows:

  1. Give the oracle user the lock pages in memory privilege. It does not have this privilege by default.
    1. Go to start->settings->control panel, double click on Adminstrative Tools.
    2. Double click Local Security Policy
    3. In the left pane, expand Local Policies and choose User Rights Assignment.
    4. In the right pane of the local security policy settings, select Lock Pages In Memory, choose Action->Security
    5. Click add
    6. Select the Oracle user from the name list
    7. Click add
    8. Click ok
    9. Click ok.
  2. Enable large page support for the oracle instances.
    1. Go to the ORACLE_BASE\ORACLE_HOME\bin\oracle. Key in the file system.
    2. Open oracle.key in a text editor and record the value found. This is a value set by the installer, and is normally SOFTWARE\ORACLE\KEY_{oracle_home_name}.
    3. Start the registry editor (regedit).
    4. Browse to HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\{key_home_name from step b}
    5. Create either of the two entries below, the first enables large pages for all instances, the second enables large pages for just the referenced sid:
      1. ORA_LPENABLE=1
      2. ORA_SID_LPENABLE=1 Nick Walter notes in his comments that both of these are string keys. Make sure they are created that way.
    6. Exit the registry Editor.

At this point, large pages are enabled for windows. Remember the caveat, it is possible, even likely that your server will need to be rebooted each time you want to start up the Oracle instances when large pages are enabled.

2 Responses to “Large Pages Implementation in Windows”

  1. Nick W Says:

    You also might want to note that ORA_LPENABLE must be a string key (REG_SZ) which the Oracle docs don’t clearly specify and can cause some setup confusion. In addition, there’s an ORA_LPSIZE registry key one can define to set the large page granule. On systems with very large SGAs there might be benefits to tweaking this value as well.

  2. Windows Large Pages | Oraculix Says:

    […] Zusammenfassung dieser Note: https://dbakerber.wordpress.com/2013/07/21/large-pages-implementation-in-windows/ […]

Leave a comment