Disclaimer

Thursday 9 September 2021

ORA-27102 out of memory on a system with huge memory

 

ORA-27102 out of memory on a system with huge memory


Today one customer said the data sync of Oracle Dataguard had issue and our guys checked the alert log then sent below errors to me:

  1. ORA-01034: ORACLE not available
  2. ORA-27102: out of memory
  3. Linux-x86_64 Error: 12: Cannot allocate memory

Also had some ORA-00313 errors about failure to open data/redo files.

While he also confirmed the instance was opened and was running.

I asked to check the memory usage, detail trace log and system message log file continually.

The system has 200G physical memory and 16G swap while at that time we only got 3M free swap! so we did get memory issue.

Our guys checked the processes using most of the swap and killed some of them while did not fix it as only very small part of swap was freed.

I got more detailed memory info through /proc/meminfo:

  1. [root@erpdg ~]# cat /proc/meminfo
  2. MemTotal: 206352512 kB
  3. MemFree: 1260976 kB
  4. MemAvailable: 520844 kB
  5. Buffers: 3160 kB
  6. Cached: 41799796 kB
  7. SwapCached: 106432 kB
  8. Active: 40449436 kB
  9. Inactive: 3372480 kB
  10. ......
  11. SwapTotal: 16777212 kB
  12. SwapFree: 108580 kB
  13. .....
  14. HugePages_Total: 72000
  15. HugePages_Free: 71984
  16. HugePages_Rsvd: 113
  17. HugePages_Surp: 0
  18. Hugepagesize: 2048 kB
  19. DirectMap4k: 323520 kB
  20. DirectMap2M: 24842240 kB
  21. DirectMap1G: 186646528 kB

If you read the above output carefully, you would already know the reason.

Then I asked our guys to do below actions:

  1. 1. Check the SGA and Memory target settings
  2. 2. Stop the database instance
  3. 3. sync; echo 3 > /proc/sys/vm/drop_caches
  4. 4. start the database instance again
  5. 5. cat /proc/meminfo again

The SGA was about 120G, and the new content of /proc/meminfo was as below:

  1. [root@erpdg ~]# cat /proc/meminfo
  2. MemTotal: 206352512 kB
  3. MemFree: 44060916 kB
  4. MemAvailable: 43266384 kB
  5. Buffers: 4192 kB
  6. Cached: 1122640 kB
  7. SwapCached: 39268 kB
  8. ......
  9. SwapTotal: 16777212 kB
  10. SwapFree: 15826640 kB
  11. ......
  12. HugePages_Total: 72000
  13. HugePages_Free: 10672
  14. HugePages_Rsvd: 113
  15. HugePages_Surp: 0
  16. Hugepagesize: 2048 kB
  17. DirectMap4k: 323520 kB
  18. DirectMap2M: 24842240 kB
  19. DirectMap1G: 186646528 kB

So this issue was caused by the HugePage memory.


For some reasons, last time when the database instances was started, it did not make use of HugePage memory as there were about 140G free HugePage memory. After the above actions now we had about 20G HugePage memory. It was correct as the SGA size was about 120G.

No comments:

Post a Comment

100 Oracle DBA Interview Questions and Answers

  Here are 100 tricky interview questions tailored for a Senior Oracle DBA role. These questions span a wide range of topics, including perf...