Tuesday, July 17, 2012

Interpreting Memory utilization by Oracle Database

# top
top - 08:04:14 up 72 days, 30 min,  4 users,  load average: 0.34, 0.33, 0.28
Tasks: 529 total,   1 running, 528 sleeping,   0 stopped,   0 zombie
Cpu(s):  0.2%us,  0.1%sy,  0.0%ni, 99.5%id,  0.2%wa,  0.0%hi,  0.0%si,  0.0%st
Mem:  98871592k total, 95466240k used,  3405352k free,   881976k buffers
Swap: 16386292k total,   571592k used, 15814700k free, 39821900k cached

From  the above top result it seems 95466240K (around 91GB) is used by our system out of 98871592k(around 94GB): almost all of the memory seems to be used up. But its not the true. This means that the system is buffering and caching around 91GB of RAM and in case this RAM is available for any process that need it. Using the 'free' command we can have a better picture.

# free
             total       used       free     shared    buffers     cached
Mem:      98871592   95464984    3406608          0     879644   39821468
-/+ buffers/cache:   54763872   44107720                               
Swap:     16386292     571592   15814700

From the above result the actul used/unused memory is given in 
-/+ buffers/cache:   54763872   44107720

This means, the system is using 54763872K (around 52 GB) for applications/process and it has a potentially free RAM of 42Gb. This one used for buffering & caching.

Now comes the question why 52 GB is used ?

1. This is because we have set fixed size sga around 1 GB   and some others  like pga+dbmon+grid control agent around 1GB.  Total = 2GB .
2.  Redhat recommends setting huge memory at 50% of physical memory. Linux will steal memory from free huge memory if needed. So kernel parameter  vm.nr_hugepages = 25600  is set and each Hugepagesize is about 2048 KB . So Total 25600 * 2048 KB = 52428800 KB = 50 GB.     Note: Doesn't look like the server has reallocated memory.

# /sbin/sysctl -a | grep -i hugepages
vm.nr_hugepages = 25600

# cat /proc/meminfo | grep -i HugePage
HugePages_Total: 25600
HugePages_Free:  25158
HugePages_Rsvd:    143
Hugepagesize:     2048 kB

3. Linux will consume all free memory for disk cache. This may cause 100% memory utilization. However, the parameter vm.min_free_kbytes=2097152 is configured on the servers to set 2GB minimum free OS memory pool at any point of time. This is needed for new database connections.                          

# /sbin/sysctl -a | grep -i min_free_kbytes
vm.min_free_kbytes = 2097152


Enhanced by Zemanta

No comments:

Post a Comment