SGA Memory

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

SGA Memory

satish
This post was updated on .
Dear Erman,

DB version 11.2.0.1.0

We have only 1 instance running on a machine which has 32Gb ram
We have increased the size of sga from 4G to 12G .
Increased PGA from 2G to 4G

But free -m shows used as 1980M and 29G as cached,Is my 12G memory not allocated to SGA?

[oracle@SSSTINDCPODB01 ~]$ free -m

             total       used       free     shared    buffers     cached

Mem:         32158      31248        909          0         64      29203

-/+ buffers/cache:       1980      30177--

Swap:        63999       5497      58502

Please suggest
Reply | Threaded
Open this post in threaded view
|

Re: SGA Memory

ErmanArslansOracleBlog
Administrator
"shared" column has a value of 0, which may be normal.
As the shared column shows the Memory used (mostly) by tmpfs (Shmem in /proc/meminfo, on kernels 2.6.32, displayed as zero if not available).

Used column shows 1980 megabytes, altough you have a 12GB sized SGA..
This is normal as well.
The cause of this is that the SGA memory is reported into the cached section for Linux.

This is from Redhat ->

One cannot just consider free + buffer + cache when it comes to Oracle database. Oracle uses SGA. Oracle SGA would keep all the shared memory in RAM, which will be unused by other applications. The SGA will be shown under "cached" in free output. The memory allocated for SGA under cache cannot be considered as available.

Sri
Reply | Threaded
Open this post in threaded view
|

Re: SGA Memory

Sri
Dear erman,

This is a very valuable information where many of us are not aware. In this case, how can we calculate free memory

Thank you
Reply | Threaded
Open this post in threaded view
|

Re: SGA Memory

ErmanArslansOracleBlog
Administrator
If you use AMM (memory_target) is in use, SGA memory will be allocate from /dev/shm.
If you don't use AMM , then the SGA will be allocated from the shared memory segments, which can be seen from the ipcs output.) -- Shared memory segments will be allocated from hugepages if they are available.

If you don't have a hugepage configuration, then the shared memory segments will be allocated using from the normal pages and those normal pages will be reported as cached in the free command output.
In that case the size of the "cached value" will be same as the segment size reported by ipcs.

If the shared memory segment is allocated using hugepages, it is not reported as cached.

In addition, you can subtract the SGA size from the "cached" value that you see in the free command output and get the memory size which is used for OS file cache.
Reply | Threaded
Open this post in threaded view
|

Re: SGA Memory

satish
Thats really helpful

Thank you,
satish