|Lesson 3||OS memory management |
|Objective||Explain UNIX memory management|
Explain UNIX memory management
The UNIX operating system is designed to manage memory structures to maximize the memory usage. UNIX rules depend upon both OS
parameters and Oracle memory parameters. The systems administrator is required to define a swap disk in all UNIX environments.
The swap disk temporarily holds memory segments that must be paged-out from UNIX to make room for
incoming memory requirements.—The swap disk is a component of the virtual memory, that memory in excess of the physical RAM memory capacity of the database server. To better understand how the swap disk functions, examine the following Slide Show.
1) Swap Disk1
2) Swap Disk2
3) Swap Disk3
4) Swap Disk4
5) Swap Disk5
What type of Interaction needs to take place between OS Parameters and Oracle memory parameters for efficient memory management to occur
In order for efficient memory management to occur between the Operating System (OS) parameters and Oracle memory parameters, the following interactions need to take place:
- Sizing the Memory Parameters: The size of the Oracle memory parameters, such as the SGA and PGA, need to be properly set in relation to the available memory on the system. Setting the memory parameters too large can lead to memory contention with the OS, while setting them too small can result in suboptimal performance.
- Setting the OS Swap Space: The OS swap space should be set to a size that is adequate to handle memory paging in the event that the available physical memory is insufficient. It's important to ensure that the swap space is large enough to handle the combined size of the SGA and the PGA, as well as any other memory-intensive processes running on the system.
- Managing the Buffer Cache: The buffer cache within the SGA is used to store database blocks in memory, reducing the need for disk I/O. The size of the buffer cache needs to be set in such a way that it does not compete with the OS for memory resources.
- Configuring the Shared Pool: The shared pool within the SGA is used to store shared SQL statements and PL/SQL code. It's important to configure the shared pool size appropriately, taking into account the workload of the system and the size of the database.
- Setting the Page Size: The page size of the OS should be set to match the database block size in order to reduce the overhead associated with disk I/O.
- Monitoring the Memory Usage: Regular monitoring of the memory usage of the system is important to ensure that the memory parameters are properly configured and to identify any potential performance issues.
By effectively managing the interaction between the OS parameters and the Oracle memory parameters, you can ensure optimal performance and prevent memory-related issues from impacting the performance of your database.
Here we see the basic constructs of virtual memory management. While it is common for all OS systems to page-out unreferenced memory, the page-in operations are of concern because they slow down the process.
Swap disk data
To display the amount of swap disk defined on your server and how much has been used, use the following UNIX command:
diogenes:> lsps –s
Total Paging Space Percent Used
While we are using UNIX in these lessons, the same virtual memory principles apply to all Oracle
servers, including NT servers and IBM mainframes. In fact, the common mainframe MVS/ESA stands for Multiple Virtual Storage/Extended Storage Architecture. The next lesson looks at a common UNIX utility for detecting memory paging.
OS Memory Management - Exercise
Before moving on to the next lesson, click the Exercise link to assess your overall understanding of virtual memory with the following matching exercise.
OS Memory Management - Exercise