Analysis of setting up super-large OracleSGA in 32-bit Linux

Source: Internet
Author: User
Article Title: Analysis of super-large OracleSGA settings in 32-bit Linux. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.

Many users think that in 32-bit Linux, only GB of Oracle SGA can be set. Many users use the same configuration process in different Linux distributions and obtain different SGA maximum values. Therefore, some Linux distributions have problems. These ideas are all one-sided. In fact, the capacity of Oracle SGA on 32-bit Linux depends on three indicators: Linux kernel version, Oracle Database version, and Linux kernel Parameter shmmax. I have reviewed some online articles and made some analysis.

  I. kernel version impact

On the 32-bit Linux platform, at least two kernels are available for users. One is the smp core and the other is the hugemem core. The difference between the two cores lies in the difference between the directly mapped kernel data code address space:

SMP core:

In x86 architecture, the virtual address space is 4 GB. In this 4G space, the user space occupies 3G (0x00000000 to 0 xbfffff), and the core space occupies 1G (0xc0000000 to 0 xffffffff ). Such an allocation policy is called 3G/1G allocation.

The specific allocation method is as follows:

1. 0 GB-1 GB User space-Used for text/code and brk/sbrk allocations (malloc uses brk for small chunks)

2. 1 GB-3 GB User space-Used for shared libraries, shared memory, and stack; shared memory and malloc use mmap (malloc uses mmap for large chunks)

3. 3 GB-4 GB Kernel Space-Used for the kernel itself

This allocation method does not have any problems for systems with less than 1 GB physical memory. Even if the physical memory exceeds 1 GB, the 3 GB/1 GB allocation policy has no problems, because the kernel can store some kernel data structures (such as page buffering) in the high-end memory area (memory with a physical address greater than 1 GB ).

However, with the increase of physical memory, problems with the 3G/1G allocation policy will gradually be exposed. This is because some key kernel data structures (such as mem_map [] used to manage physical memory) are stored within 1 GB of core space. For 32 GB memory systems, mem_map [] will occupy nearly 1.5% GB of low-end memory (memory with a physical address less than MB), leaving less than of the memory for other core parts; for 64 GB memory systems, mem_map [] itself will consume all the low-end memory, causing the system to fail to start. However, the practice of putting mem_map [] into high-end memory is not practical, because mem_map [] and memory management, architecture-related underlying implementation, almost all the key parts of file systems and drivers are associated, and hugemem core is needed at this time.

  Hugemem core:

Unlike SMP's 3G/1G policy, hugemem uses a 4G/4G allocation method. It can increase the core space from 1G to 4G, and the user space from 3G to 4G.

Compared with the 3G/1G allocation policy, for a 4G/4G physical memory system, the use of 4G/4G allocation can increase the low-end memory by more than 3 times. For a 32G physical memory system, there will be more improvements, six times of the original. In theory, the 4G/4G strategy can support x86 systems with a physical memory of G (if there is no hardware limit), even for such systems, the 4G/4G policy can also ensure that 1G of available low-end memory is available.

Whether you can understand the above explanation, you only need to remember the smp and hugemem cores. One is a 3G/1G strategy, and the other is a 4G/4G strategy.

Ii. Oracle Database version:

Oracle SGA is mounted in the memory user space. Different Versions of Oracle databases have different starting addresses for mounting SGA:

Oracle 10g Release 1: The starting address for mounting SGA is 0 × 50000000 (1.25 GB)

Oracle 10g Release 2: The starting address for mounting SGA is 0 × 20000000 (0.5 GB)

(Check other versions. If you are interested, check the Oracle manual)

From this result, we can see that in theory, if the smp core of 3G/1g is used, the SGA of Oracle 10G Release 1 can be set to 3 GB-1.25 = 1.75 GB. Therefore, some people think that Oracle SGA can only be set to 1.75 GB. To upgrade to R2, you can set it to 3 GB-0.5 GB = 2.5 GB. Similarly, it is clear how much SGA can be obtained using the 4G/4G hugemem core.

[1] [2] Next page

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.