Checking usage of HugePages by Oracle databases in Linux environments

Yesterday several databases on one server started logging errors in the alert log:

That means not enough contiguous free memory in the OS. The first thing that I have checked has been of course the memory, and the used huge pages:

The memory available (last column in the free command) was indeed quite low, but still plenty of space in the huge pages (86k pages free out of 180k).

The usage by Oracle instances:

You can get the code of in this post.

Regarding pure shared memory usage, the situation was what I was expecting:

360G of shared memory usage, much more than what was allocated in the huge pages.

I have compared the situation with the other node in the cluster: it had more memory allocated by the databases (because of more load on it), more huge page usage and less 4k pages consumption overall.

So I was wondering if all the DBs were property allocating the SGA in huge pages or not.

This redhat page has been quite useful to create a quick snippet to check the huge page memory allocation per process:

It has been easy to spot the databases not using huge pages at all:

Indeed, after stopping them, the huge page usage has not changed:

But after starting them back I could see the new huge pages reserved/allocated:

The reason was that the server has been started without huge pages first, and after a few instances started, the huge pages has been set.




The following two tabs change content below.


Principal Product Manager at Oracle
Ludovico is a member of the Oracle Database High Availability (HA), Scalability & Maximum Availability Architecture (MAA) Product Management team in Oracle. He focuses on Oracle Data Guard, Flashback technologies, and Cloud MAA.

6 thoughts on “Checking usage of HugePages by Oracle databases in Linux environments

    • Thanks Zhwsh,
      I did not know about nr_overcommit_hugepages kernel parameter. It is a nice complement to USE_LARGE_PAGES = ONLY.
      My post was more intended to explain “how to react in case of wrong configuration” rather than “how to configure huge pages correctly”, but your comment is very valuable 🙂

  1. Great post Ludovico. Anyway, ‘USE_LARGE_PAGES = ONLY’ is a good way to avoid such situation. Startup will fail if the sufficient amount of hugepages are not available.

  2. Thanks Ludo, One more time was fun reading your blog on my bus travel to the office. Good work keep blogging your issues.

Leave a Reply

Your email address will not be published. Required fields are marked *

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