Re: Server is swapping with free memory available

From: Mark J. Bobak <mark_at_bobak.net>
Date: Thu, 21 Mar 2019 14:25:50 -0400
Message-ID: <CAFQ5AC+9VRYjfWTx1f67aVXuqsAwFcQXNDdnwPE_bdedzR09Fg_at_mail.gmail.com>



If you're not using huge pages, you're doing it wrong.

On Thu, Mar 21, 2019, 04:31 Jonathan Lewis <jonathan_at_jlcomp.demon.co.uk> wrote:

>
> I find it really annoying that I can read through what I've typed and not
> spot a painfully obvious error.
>
> With apologies:
>
> "If you're not using page tables ..."
>
> should read
>
> "If you're not using huge pages ..."
>
> You've reported that you're using 18GB of page tables:
> "PageTables: 18661352 kB"
>
> That's space for 2,388,653,056 pointers to pages - and each page is
> current 4KB.
> In other words you're holding maps for roughly 9 Terabytes of memory - on
> a machine with 512GB of memory.
> This happens because every process keeps its own map of the memory it is
> using.
>
> If you switch to huge pages each pointer would point to 2MB rather than
> 4KB, and that 18GB of pointers would have been 37MB.
>
> Regards
> Jonathan Lewis
>
>
> ________________________________________
> From: oracle-l-bounce_at_freelists.org <oracle-l-bounce_at_freelists.org> on
> behalf of Jonathan Lewis <jonathan_at_jlcomp.demon.co.uk>
> Sent: 20 March 2019 08:14
> To: dimensional.dba_at_comcast.net; mark_at_bobak.net; nupendra_at_hotmail.com
> Cc: gogala.mladen_at_gmail.com; oracle-l_at_freelists.org
> Subject: Re: Server is swapping with free memory available
>
>
> Following up on Niall's comment about huge pages and page tables.
>
> If you're not using page tables then each session has a memory map based
> on a 4KB page size - and each pointer in the map is 8 bytes.
>
> If it takes 8 bytes for a session to find a 4KB page, for every 512
> sessions you need 4KB of map for every 4KB of mapped memory - in other
> words if you have 512 processes connected to an Oracle SGA then you're
> using as much memory in the maps as you are in the SGA.
>
>
> As someone else said - there could be some effect of a spike that has
> passed with memory now reloading from swap. The spike might simply have
> been a sudden large jump in the number of connected sessions.
>
> Regards
> Jonathan Lewis
>
> ________________________________________
> From: oracle-l-bounce_at_freelists.org <oracle-l-bounce_at_freelists.org> on
> behalf of Upendra nerilla <nupendra_at_hotmail.com>
> Sent: 20 March 2019 03:26:29
> To: dimensional.dba_at_comcast.net; mark_at_bobak.net
> Cc: gogala.mladen_at_gmail.com; oracle-l_at_freelists.org
> Subject: Re: Server is swapping with free memory available
>
> Not using hugepages as of now, I am looking into implementing it though.
>
>
> ________________________________
> From: oracle-l-bounce_at_freelists.org <oracle-l-bounce_at_freelists.org> on
> behalf of Mark J. Bobak <mark_at_bobak.net>
> Sent: Tuesday, March 19, 2019 8:36 PM
> To: dimensional.dba_at_comcast.net
> Cc: gogala.mladen_at_gmail.com; oracle-l_at_freelists.org
> Subject: Re: Server is swapping with free memory available
>
> Arr you using hugepages?
>
> On Tue, Mar 19, 2019, 19:40 <dimensional.dba_at_comcast.net<mailto:
> dimensional.dba_at_comcast.net>> wrote:
>
> Is your database currently swapping as in active pages moving in and out
> of swap?
>
> vmstat 5 200
>
>
>
> Does the si and so columns have anything besides 0?
>
>
>
> Or do you just have swap being consumed by processes from some previous
> over whelm of memory event?
>
>
>
> What specific processes are using swap?
>
>
>
> Need to run as root to see everything
>
> for file in /proc/*/status ; do awk '/VmSwap|Name/{printf $2 " " $3}END{
> print ""}' $file; done | awk '$3 == "kB" && $2 != 0 {print $1" "$2" "$3 }'
>
>
>
>
>
>
>
>
>
>
>
> Matthew Parker
>
> Chief Technologist
>
> Dimensional DBA
>
> Oracle Gold Partner
>
> 425-891-7934 (cell)
>
> D&B 047931344
>
> CAGE 7J5S7
>
> Dimensional.dba_at_comcast.net<mailto:Dimensional.dba_at_comcast.net>
>
> View Matthew Parker's profile on LinkedIn<
> http://www.linkedin.com/pub/matthew-parker/6/51b/944/>
>
> www.dimensionaldba.com<http://www.dimensionaldba.com/>
>
>
>
>
>
> From: oracle-l-bounce_at_freelists.org<mailto:oracle-l-bounce_at_freelists.org>
> <oracle-l-bounce_at_freelists.org<mailto:oracle-l-bounce_at_freelists.org>> On
> Behalf Of Mladen Gogala
> Sent: Tuesday, March 19, 2019 3:52 PM
> To: oracle-l_at_freelists.org<mailto:oracle-l_at_freelists.org>
> Subject: Re: Server is swapping with free memory available
>
>
>
> Have you tried with FILESYSYSTEMIO_OPTIONS=ALL?
>
>
>
> On 3/19/19 4:54 PM, Upendra nerilla wrote:
>
>
>
> Hello everyone -
>
> We have a database server which is choosing to swap though there is plenty
> of free memory.
>
> Any pointers on what to check are much appreciated..
>
>
>
> --
>
> Mladen Gogala
>
> Database Consultant
>
> Tel: (347) 321-1217
> --
> http://www.freelists.org/webpage/oracle-l
>
>
> --
> http://www.freelists.org/webpage/oracle-l
>
>
>

--
http://www.freelists.org/webpage/oracle-l
Received on Thu Mar 21 2019 - 19:25:50 CET

Original text of this message