Solaris memory allocation

January 14th, 2009 | Categories: Book, Boring | Tags: ,

留个

这是Solaris 8+的内存分配图

Cache list + Free list = vmstat.free

reclaim = vmstat.re

Mapped file + Segmap File Cache = kstat -k::memstat中的page cache

而这个Segmap File Cache的大小在Solaris/SPARC有个限制,由/etc/system参数segmap_percent决定,默认是12。就是说segmap file cache的最大值可以为12%的物理内存大小. 也就说说 segmap file cache是hot&active file pages cache ; Cache list是inactive file pages cache.

Segmap tuning中说道  6256083 Need a lightweight file page mapping mechanism to substitute segmap,大概可以在这个例子中显示出来,solaris10比solaris9对于FS cache使用更少的cross calls (mpstat.xcall)。

至于truss cp等看到的mmap64  munmap 等core function就不好理解了。

SunOS  sun4u sparc SUNW,Sun-Fire-V440 > ls -altr
total 6874016
-rw-rw—-   1 oracle   dba      6078464 Jan 13 23:19 cntrl_lewu_1.dbf
-rw-rw—-   1 oracle   dba      6078464 Jan 13 23:19 cntrl_lewu_2.dbf

truss  cp cntrl_lewu_1.dbf abc

mmap64(0×00000000, 6078464, PROT_READ, MAP_SHARED, 3, 0) = 0xFEC00000
write(4, “\0C2\0\0FFC0\0\0\0\0\0\0″.., 6078464) = 6078464
munmap(0xFEC00000, 6078464)                     = 0

搞不懂这个mmap64分配的6078464byte内存算是mapped file还是segmap file cache。

Del.icio.us Google书签 Digg Live Bookmark Technorati Furl Yahoo书签 Facebook 百度搜藏 新浪 ViVi 365Key 网摘 天极网摘 和讯网摘 博拉网 POCO 网摘 饭否 QQ 书签 Digbuzz 我挖网 Mister Wong
No comments yet.