Re: RHEL memory questions

From: De DBA <dedba_at_tpg.com.au>
Date: Thu, 01 Oct 2015 14:23:45 +1000
Message-ID: <560CB551.4020801_at_tpg.com.au>



Sorry, I did not realise there was a second question..

At least up to Windows 2008, Oracle on Windows has to operate within one process memory area and all processes, including dedicated server connections, are threads consuming space in this memory area. This used to be limited to 3GB user memory + 1GB kernel memory, regardless of the total amount of memory installed in the system, but that may have changed.

In Linux/UNIX systems the oracle processes can use shared memory and don't have to limit themselves to one process memory area.The SGA is allocated as shared memory and the oracle processes run as separate processes, rather than threads. Each process that connects to the shared memory has the size of that memory added to the total process memory as reported by ps(1) or top(1). You can see the shared memory in the system with "ipcs -m".

As a result, if you were to summarise the memory (virtual memory) for each process, you could well end up with a figure that is much bigger than the total available memory! Personally, I've always found that querying the database to find the total memory used (v$process, v$sgastat) is much easier ;)

You limit the memory consumed by tweaking the size of the SGA and PGA, just as you would in Windows. The difference is that the number of user processes does not impinge on the memory available to Oracle as a whole (supposing that enough system memory exists, of course).

Cheers,
Tony

On 01/10/15 13:48, De DBA wrote:
> Hi David,
>
> Yes this is normal. As an aside, you may be losing important detail by using the "-g" switch on the free(1) utility. On my workstation:
>
> $ free -tg
> total used free shared buffers cached
> Mem: 7 5 1 0 0 3
> -/+ buffers/cache: 1 5
> Swap: 0 0 0
> Total: 8 5 2
>
> There is no swap at all...! Of course there is, but it's just under 1 GB:
>
> $ free -th
> total used free shared buffers cached
> Mem: 7.3G 5.8G 1.5G 0B 237M 3.8G
> -/+ buffers/cache: 1.8G 5.5G
> Swap: 972M 16M 956M
> Total: 8.3G 5.9G 2.4G
>
> In monitoring scripts it may be useful to use the -m switch, or just keep the default output (kB on my system).
>
> Unlike Windows, the Linux kernel optimises performance by using spare physical memory for things as file buffer and paging, and refrains from paging out to disk until all other options are exhausted (including reducing buffers and cache to the absolute necessary minimum). Actual free memory is close to (but not exactly) free + buffers + cached, some 5.5GB in the above case, as shown in the second line. Not all buffers and cache can be de-allocated, so it's not exact that. Swap as reported by free(1) and friends is the swap device, not total paging space.
>
> On your server, 4GB is actually in use, 58GB is "free" (taking buffers & cache into account).
>
> Hth.
>
> Tony
>
>
> On 01/10/15 09:53, David Ramírez Reyes wrote:
>>
>> Hello List!
>>
>> Am just starting working with Oracle (11g R2) over RHEL(5) and I have some basic doubts that I would like to clarify (until now, I’ve been working with Oracle over Windows):
>>
>> -As part of a daily DB report, I need to check the memory usage of the server and am getting these:
>>
>> total used free shared buffers cached
>>
>> Mem: 62 61 1 0 1 55
>>
>> -/+ buffers/cache: 4 58
>>
>> Swap: 31 0 31
>>
>> Total: 94 61 33
>>
>> As you can see, “free” memory is almost over (although there’s no swap) which makes me report that memory usage is at 98% (it sounds strange to me), is this a normal behavior?; I’ve checked the processes running and there’s no a pick process but many opened by the oracle connections to the DB; depending on the answer, the next questions would be if more memory is required or if there’s a way to limit the memory that Oracle uses (on Windows, there’s a single Oracle process –with all subprocesses inside- and is very easy to determine and restrict the memory used by the DB, here in Linux seems like I need to sum the memory used by all processes for oracle user and seems not easy to restrict to a limit, is this correct?).
>>
>> Any advice, tip or trick for an Oracle DBA over Linux is well received.
>>
>> Thanks
>>
>> David Ramírez Reyes
>> Profesión: Padre de Familia
>>
>>
>>
>>
>

--
http://www.freelists.org/webpage/oracle-l
Received on Thu Oct 01 2015 - 06:23:45 CEST

Original text of this message