Exploring PGA usage

Sorting out how Oracle RDBMS uses physical memory.
We have: Oracle RDBMS 11g, Solaris 10 SPARC, total 64 GB physical memory available.
select sum(pga_alloc_mem)/1024/1024/1024 from v$process
3 GB

select sum(value)/1024/1024/1024 from v$sga
35,8 GB

sga_max_size = 36 GB

swap -s
total: 41424832k bytes allocated + 926416k reserved = 42351248k used, 1573376k available
# echo ‘::memstat’ | mdb -k
Page Summary                Pages                MB  %Tot
————     —————-  —————-  —-
Kernel                     627638              4903    8%
ZFS File Data             1052704              8224   13%
Anon                      5143977             40187   62%
Exec and libs               33809               264    0%
Page cache                 325648              2544    4%
Free (cachelist)           922021              7203   11%
Free (freelist)            129423              1011    2%

Total                     8235220             64337
Physical                  8213594             64168

sar -r 1 1

SunOS mer1.tcinet.ru 5.10 Generic_142909-17 sun4u    06/24/2016

12:43:12 freemem freeswap
12:43:13 1062753  4002032

1062753 = Free (cachelist) + Free (freelist) = 922021 + 129423

Memory used by user processes (Anon):
40410 MB = 39,5 GB

Memory used by user processes other then RDBMS:

39,5 – 36 – 3 = 0,5 GB

At peak memory usage we have:

– total PGA allocated increases by 2.5 GB to the maximum of 5.5 GB.
– free memory page count decreases from 1.1M to 0.5M. Page size is  8192к, consequently the difference in memory usage is 4.6 GB.

Then PGA usage demonstrates less consumption than the estimation based on OS memory pages.
———————————————————-

To look up detail usage of PGA at the moment:

select category, sum(allocated), sum(used) from v$process_memory
group by
category

Historical usage of PGA:

select * from dba_hist_process_mem_summary
where
snap_id = 66130

select * from dba_hist_pgastat
where
snap_id = 66130