Re: Physical Memory Fully Used and Swap is Not Used

From: Tanel Poder <>
Date: Thu, 2 Jul 2009 01:23:53 +0300
Message-ID: <>

Yeah, these are the /proc/sys/vm/swappiness and /proc/sys/vm/overcommit* parameters.

I think in a regular database server the swappiness should be 0 as background file maintenance operations (like backups, tar, gzip, find) should not be able to page out Oracle's server processes.

And allowing virtual memory overcommit is even a bigger joke ( having /proc/sys/vm/overcommit_memory as 0 or 1 ). This allows Linux to commit more address space to process than there's swap+RAM available. Thus when the processes actually start touching the pages and really reserving them from swap/RAM then they can just die in the page fault code. Or even worse - the out of memory killer (OOM killer) will just pick a "random" process and kill it to free up some memory!

The overcommit_memory parameter should be 2 in a database server, along sufficient swap space to back the memory allocations.

Tanel Poder

On Wed, Jun 24, 2009 at 10:43 AM, Teehan, Mark <> wrote:

> Hi Mudhlavan,
> I agree with LS, and much depends on your version of Redhat.
> Linux does behave differently and uses any free RAM to speed up filesystem
> operations; to prove it run a top while you gzip a file and see what happens
> to free RAM.
> Check orca if you have it running; you should see memory usage gradually
> increase following a restart dependant on filesystem operations.
> I've seen chronic problems with memory starvation on RH4; I believe it was
> hardware dependant but if the OS allowed free RAM to drop too low (15MB or
> so) during heavy I/O that is not using direct I/O, (gzips, ftp, hot
> backups) then kswapd kicked in a little to late to rescue the situation and
> could sometimes hang the OS.
> I believe these problems are fixed on RH5. Performance problems are
> probably not related to swap at all; and AWR is probably the best tool on
> hand.
> Rgds
> Mark
> ------------------------------
> *From:* [mailto:
>] *On Behalf Of *LS Cheng
> *Sent:* 24 June 2009 14:44
> *To:*
> *Cc:*
> *Subject:* Re: Physical Memory Fully Used and Swap is Not Used
> Hi
> In the IO side you should enable direct i/o and aio in Linux (if you are
> using filesystems).
> In the memory side you should enable hugepages, this is a nonswappable
> memory, i.e all SGA will be in physical memory. Be careful when setting this
> up though, some miss calculations will make Oracle use normal pages.
> Regarding Linux uses all memory, that behaviour is default behaviour for
> ages, Linux tries to cache everything and uses all memory. Why leave memory
> free when you can use it, I think that is philosophy. There were some kernel
> parameters to change this behaviour but since Linux changes pretty fast and
> I cant really tell you if they still work in your Linux platform. Last time
> I checked they were working for RHEL 4 but no longer in RHEL 5 and I cant
> find the corresponding kernel parameters in RHEL 5 :-(
> About your performance problem I think you better identify them first
> inside database (look some statspack or AWR if you have license). If Swap is
> not in use then the OS is not swapping, if there are heavy swap going on in
> Linux kswapd kicks in, in heavy memory starvation system when kswapd wakes
> up and freeing memory it hangs the system too! :-)
> Thanks
> --
> On Tue, Jun 23, 2009 at 7:41 AM, Mudhalvan Moovarkku <
>> wrote:
>> Dear DBAs,
>> We have recently migrated Oracle from 8.0.6 on HP-Unix to
>> on Red Hat Linux
>> Earlier the same application worked fine with 7GB RAM on HP-UNIX
>> on PA-RISC
>> Upgraded system on IBM X 3850 with 16GB RAM but still we have
>> some performance issue.
>> I knew there is some lagging because of Hardware Architecture but
>> it is too bad 7 GB to 16GB RAM but still have performance.
>> Please look at data collected from RDA. Looking at this scenario
>> my physical memory is fullly used but Swap is not at all used.
>> Total Physical Memory 16032 MiB
>> Available Physical Memory 30 MiB
>> Swap: Max Size 24575 MiB
>> Swap: Available 24505 MiB
>> Swap: In Use 70 MiB
>> We know there is some performance issue in application. I would
>> like to make as much as possible from Database/Linux side tunning to
>> provide atlease peaceful performance. Can any body through some light on why
>> the swap is not at all used.
>> Regards
>> Mudhalvan M.M
> ==============================================================================
> Please access the attached hyperlink for an important electronic communications disclaimer:
> ==============================================================================
-- Tanel Poder --
Received on Wed Jul 01 2009 - 17:23:53 CDT

Original text of this message