To best use available memory, you must be aware of at least three memory-related areas:
The SGA
Memory components on a server
TNS connections
Explain Virtual Memory
Virtual memory is a technology that provides a computer with an illusion of having more memory than it physically has. It's implemented as a combination of RAM and disk space, and it enables the computer to run larger applications or multiple applications at the same time.
When a computer runs out of physical memory (RAM), the operating system (OS) uses a portion of the hard disk space as an extension of RAM. This extension of RAM is called virtual memory, and it works by temporarily transferring data from RAM to the hard disk. The data is transferred back to RAM when it's needed again. This process is known as "swapping" or "paging."
Virtual memory enables the OS to efficiently manage the limited physical memory available and improve the performance of the computer by allowing it to run applications that require more memory than is physically available.
However, virtual memory is slower than physical memory because disk access is slower than RAM access. This can result in slower performance and increased disk activity, especially when the computer is running multiple applications at the same time.
In summary, virtual memory is a useful technology that enables a computer to run larger applications or multiple applications at the same time, even if it doesn't have enough physical memory. However, it can result in slower performance and increased disk activity, so it's important to monitor its usage and make sure the computer has enough physical memory and disk space.
Memory and SGA
To properly manage RAM memory in the OS environment, you must tune numerous elements that make up the SGA, including the data pool, the shared pool, and the redo log buffer, as well other smaller memory components. Roll your cursor over the following MouseOver to see pop-up explanations of the various parts of the SGA and their function in memory usage.
Memory Components on a Server
There is a great deal of RAM memory allocated within Oracle. However, there are other memory components on a server.
These include memory for the Oracle Shared Server and for the user areas as determined by the sort_area_size.
Some shops segregate memory usage by dedicating a server exclusively for the Oracle database.
TNS Connections
Even with a dedicated server, you can still have TNS connections that consume memory. Each incoming dedicated TNS connection process will have memory allocated according to the size specified by the sort_area_size init.ora parameter. If you have hundreds of connections, this memory can become excessive and cause memory paging. Paging occurs when UNIX has more memory requests than physical RAM memory. In these cases, UNIX will swap memory onto a swap disk.
Note: If you experience excessive memory usage because of a large number of user connections, using the
Oracle Shared Server will greatly reduce this memory demand. The MTS uses dedicated dispatcher processes, thereby reducing the amount of memory required for each user connection. The next lesson looks at how virtual memory is managed in the OS environment.
Does Oracle Shared Server make use of dedicated dispatcher processes?
Yes, Oracle Shared Server does make use of dedicated dispatcher processes.
In a shared server architecture, the client connections are handled by a pool of shared server processes, also known as dispatchers. These dispatchers receive client requests, assign a shared server process to handle the request, and manage the communication between the client and the shared server process. The shared server process performs the requested task and returns the results to the dispatcher, which then returns the results to the client.
Each dispatcher runs as a separate process and is dedicated to handling client connections. This allows the dispatchers to handle multiple client connections concurrently and increases the scalability of the database.
In contrast, in a dedicated server architecture, each client connection is handled by a separate dedicated server process. This architecture is less scalable and less efficient than the shared server architecture, as each dedicated server process consumes more memory and resources.
Oracle Shared Server does make use of dedicated dispatcher processes, which are responsible for managing client connections and communication with the shared server processes.