Tru64 Unix
1753265 會員
5165 線上
108792 解決方案
發表新文章

當Startup Oracle DB後,所使用的Memory 比SGA Size小

 
watermelonyu
教授

當Startup Oracle DB後,所使用的Memory 比SGA Size小

小第不解Oracel DB SGA在Satrtup DB所呈現的"Total System Global Area"為175866852 bytes,但觀察Free Memory僅減少約9K pages (72MB),但從ipcs -mob 得shared memory有與SAG size 相同,故無法了解1.為何在Satrtup DB後並未能一次allocate SGA所需 memory? 2.那何時SGA所需求Size方能完全allocate ? 3.是否有參數設定有問題?

請詳log!



謝謝!
6則回覆 6
watermelonyu
教授

當Startup Oracle DB後,所使用的Memory 比SGA Size小

Hi Henry,



From the output of vmstat statement:

f1twdb#ora817> vmstat 2 5

Virtual Memory Statistics: (pagesize = 8192)

procs memory pages intr cpu

r w u act free wire fault cow zero react pin pout in sy cs us sy id

3 304 41 273K 21K 21K 8G 286M 7G 24M 624M 361K 108 4K 582 20 8 72

3 304 41 273K 21K 21K 65 15 20 0 28 0 13 46 294 1 1 98



The total memory is just used

273K + 21K + 21K = 315K (pages) = 2.4GB

I think it has the total physical memory 3GB on the Alpha system f1twdb, wasn't it?

So that it has the other 500 ~ 600MB is reserved on GH usage.

See both "gh_chunks" and "rad_gh_regions" from "# man sys_attrs_vm".



# sysconfig -q vm | grep gh_



Best regards,

Richard.
watermelonyu
教授

當Startup Oracle DB後,所使用的Memory 比SGA Size小

The total physical memory is 2.5GB on the Alpha system f1twdb.



f1twdb#root> vmstat -P



Total Physical Memory = 2560.00 M

= 327680 pages



And,gh_chunks=0





f1twdb#root> sysconfig -q vm | grep gh_

gh_chunks = 0

gh_min_seg_size = 4194304

gh_fail_if_no_mem = 1

vm_l3gh_anon = 1

vm_l3gh_shm = 1

vm_l3gh_ssm = 1

gh_keep_sorted = 0

gh_front_alloc = 1
watermelonyu
教授

當Startup Oracle DB後,所使用的Memory 比SGA Size小

Hi Henry,



No GH reserved for shared memory used on SGA on Oracle DB running.



First you need to know:

1) The act of vmstat field is included active, inactive and UBC buffer, more large AP process running should be allocated the pageable inactive first or UBC before getting the free memory list.

2) SGA of Oracle DB is used on virtual memory that included the physical memory and swap space.



You could see the SGA "175866852 bytes" is truly used on Oracle processes. See the result at the field VSZ from "ps aux | grep ora_"



Please provide the following output if possible.

# swapon -s

# vmstat -P

# ps aux|grep ora_

# sysconfig -q vm|grep target



PS: If possible, please retesting the DB restarting and compare with inact of "vmstat -P" output.



Best regards,

Richard.
watermelonyu
教授

當Startup Oracle DB後,所使用的Memory 比SGA Size小

hi,

附件是我整理的oracle 啟動後memory allocate 的變化表
watermelonyu
教授

當Startup Oracle DB後,所使用的Memory 比SGA Size小

根據我的附件,似乎sga allocate size跟vmstat裡面 free 減少的size的確不會相等

如果sga 的確有使用這麼多的空間

那是否表示vmstat 裡面的free 記算是不正確的呢或是少算了什麼東西?

watermelonyu
教授

當Startup Oracle DB後,所使用的Memory 比SGA Size小

Hi Joey, Henry,



> 根據我的附件,似乎sga allocate size跟vmstat裡面

> free 減少的size的確不會相等

Yes. It is different if only DB instance server processes starting.

也就是說, 減少的 free memory 低於您所看到的 SGA space.



When DB server processes running, the shared memory

(VM - Virtual memory) allocation matched to SGA and

the VSZ of "ps aux" will greater to SGA as you saw.

But the physical memory access will calling from Virtual

memory address mapping to physical memory address

while DB program processes gradually running increasingly.



For example:

SQL> show sga

Total System Global Area 2664649700 bytes

Fixed Size 103396 bytes

Variable Size 1844305920 bytes

Database Buffers 819200000 bytes

Redo Buffers 1040384 bytes



The Database Buffers (819200000 bytes) should be

allocated immediately while DB starting, but the Variable Size

will processing by DB jobs running.



就好像是一 ora_dbfile.dbf pre-allocted a filesize 10GB,

但是它真正的資料可能只有 10MB.

其餘皆是 sparse data.



詳盡的 SGA 使用狀況得諮詢 ORACLE 公司.



PS: Explain both VSZ and RSS on ps aux.



Process virtual address size (VSZ)--This is the total amount of anonymous memory allocated to the process (in bytes).





Real memory (resident set) size of the process (RSS)--This is the total amount of physical memory (in bytes) mapped to virtual pages (that is, the total amount of memory that the application has physically used). Shared memory is included in the resident set size figures; as a result, the total of these figures may exceed the total amount of physical memory available on the system.



Best regards,

Richard.