We have several dozen Redhat 5, 6 and 7 servers that are running Oracle databases. On some databases we are using automatic memory management, which uses shared memory. On other databases we are use manual memory management, which does not use shared memory.
When I see that a server is swapping and not using that much shared memory, does it make sense to shrink the amount of shared memory allocated to reduce the swap usage? I have read that setting /dev/shm does not allocate memory. But I wonder if it is still preventing non shared memory from staying in physical memory.
The database will have a configuration for memory that it requires to be real memory rather than being eligible to be swapped. If you exhaust real memory by having too much guaranteed as real memory for all the databases put together, then the server as a whole can suffer. If a general process requires some memory and there is very little swap-able available, then the new process will be almost permanently waiting for swap as it tries to perform whatever it needs.
You don't say what versions of Oracle you are using, but the principle is the same, although they may configure it in different ways.
Hi Robin, We are mostly using Oracle 11.2.0.3 and 12.1.0.2. Some of our servers are in the AWS cloud and I can change OS parameters there. But for the servers that are running out of our server room, I need to justify any OS changes that I want. By default the servers allocate half the total memory to shared memory whether or not we are using AMM, or shared memory. Hence, I am trying to figure out what benefits we would get from shrinking /dev/shm on servers where we aren't using shared memory. Would it even make a difference.
---------- Post updated at 10:40 AM ---------- Previous update was at 10:11 AM ----------
For example, I increased the AMM memory on two databases on this server
from 1GB to 3GB, and the total memory allocated when down.
It just seems like Redhat is holding onto shared memory that would be better
off not being shred memory, thus reducing the amount of swap being used.
There are 12 databases on this server, most do not use shared memory.
BEFORE INCREASE
$: ~ > free -m
total used free shared buffers cached
Mem: 32186 31987 198 0 872 26785
-/+ buffers/cache: 4329 27856
Swap: 20474 4340 16133
$: ~ > df -h /dev/shm
Filesystem Size Used Avail Use% Mounted on
tmpfs 26G 5.4G 20G 22% /dev/shm
AFTER INCREASE
$: ~/scripts/sql > free -m
total used free shared buffers cached
Mem: 32186 29764 2421 0 1038 24912
-/+ buffers/cache: 3813 28372
Swap: 20474 4254 16220
$: ~/scripts/sql > df -h /dev/shm
Filesystem Size Used Avail Use% Mounted on
tmpfs 26G 8.1G 18G 32% /dev/shm