Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Re: 9i - Dynamic SGA - SGA_MAX_SIZE

Re: 9i - Dynamic SGA - SGA_MAX_SIZE

From: Tanel Poder <tanel.poder.003_at_mail.ee>
Date: Fri, 01 Aug 2003 06:29:24 -0800
Message-ID: <F001.005C83D1.20030801062924@fatcity.com>


Hi!

> Oracle says this is what you would expect. It will grab the entire value
of
> SGA_MAX_SIZE.
>
> This certainly seems to be correct I just think it is stupid. Why grab
the
> memory from the os but never use it.

Check from man pages of ps, top or other utility, how to check how much of the *physical* memory is actually used by Oracle. I'm no Unix memory management expert, but I believe that if you use malloc() and for allocating memory, no physical memory pages are grabbed before you actually access the memory (note that calloc() does 'touch' every page, I believe) Only mapping with virtual memory is done at first, that probably means only some slight changes to kernels/CPUs paging or whatever memory mapping and translation tables. So, Oracle probably 'allocates' the memory set with sga_max_size, but uses only as much as needed or allowed. So, If you set sga_max_size to 2G but have defined SGA to be only 1G, then no more than 1G of physical memory can ever be used by Oracle SGA. Only virtual memory (which means swap space too) is 'wasted'.

You can try to experiment - write a small C program, which allocates 100M of memory without 'touching' it, the amount of available physical memory should remain (almost) the same and no paging should occur either.

With sga_max_size Oracle makes sure, that in some point of time it is possible to allocate that much of virtual memory to Oracle and nothing is really wasted (ok, a bit of swap space is wasted, but who cares about few gigabytes novadays))

Tanel.

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Tanel Poder
  INET: tanel.poder.003_at_mail.ee

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
Received on Fri Aug 01 2003 - 09:29:24 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US