Amir,
This is not entirely normal - the scale of the flush is a little extreme, and ties in with your earlier question about "session param values".
-- get here if (a) reserved pool has no free space (b) reserved pool was not checked
loop detach some items from end of library cache LRU distribute items to shared pool free list - coalescing where possible check for large enough chunk on free list return if allocation succeeds end loop
There may be a limit on the number of times round the loop - but I've seen highly concurrent OLTP systems flush several hundred megabytes from the library cache - hammering the library cache and shared pool latches to death for seconds at a time doing this.
As a rough guide line, if you are seeing catastrophic memory thrashing, check that your shared_pool_reserved is about 25KB * sessions plus a few MB. (A query against x$ksmspr will tell you how much of the memory is used for things other than session parameters), and that's at least the size you need for the "few MB extra").
select sum(KSMCHSIZ) from x$ksmspr where ksmchcom not in ('free memory','session param valu')
(Don't try this against x$ksmsp, the shared pool, it could cripple your system for anything up to a couple of minutes if it's a system with a large shared pool and lots of users). (the session parameter component has a couple of changes in its name across Oracle versions).
select ksmchcom,count(*),sum(ksmchsiz) from x$ksmspr group by ksmchcom;
(again - DON'T run it against x$ksmsp).
Regards
Jonathan Lewis
http://www.jlcomp.demon.co.uk/faq/ind_faq.html The Co-operative Oracle Users' FAQ
http://www.jlcomp.demon.co.uk/cbo_book/ind_book.html Cost Based Oracle: Fundamentals
http://www.jlcomp.demon.co.uk/appearances.html Public Appearances - schedule updated 2nd Feb 2006
This is normal behavior as chunks are flushed from and added to the shared pool, the memory fluctuates. As long as you are not seeing ORA-04031 error or contention on the shared pool latch is not too high, you are fine. What RDBMS version are you on?
-----Original Message----- From: oracle-l-bounce@xxxxxxxxxxxxx [mailto:oracle-l-bounce@xxxxxxxxxxxxx] On Behalf Of genegurevich@xxxxxxxxxxxxxxxxxxxxx Sent: Wednesday, February 08, 2006 12:28 PM To: oracle-l@xxxxxxxxxxxxx Subject: Re: SGA Free memory
Hi all:
I am watching the usage of the SGA on my database via the following command:
select to_char(sysdate,'mm-dd-yyyy hh24:mi:ss'), name, bytes/(1024*1024) from v$sgastat, dual where pool like '%shared%' and name = 'free memory' order by bytes asc ;
I am running it every 10 seconds. Recently I saw the free memory going from 25M to 145M over the course of 10 sec. I'm wondering what could have caused it. Would appreciate any suggestions
thank you
Gene Gurevich Oracle Engineering 224-405-4079
-- //www.freelists.org/webpage/oracle-l
-- //www.freelists.org/webpage/oracle-l
-- //www.freelists.org/webpage/oracle-l