免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
楼主: jhualin
打印 上一主题 下一主题

请问用什么命令可以查看物理内存的占用情况? [复制链接]

论坛徽章:
0
21 [报告]
发表于 2005-10-20 13:52 |只看该作者

请问用什么命令可以查看物理内存的占用情况?

确实是比较好的方法。尤其是可以了解到Free (cachelist) 这个参数。但是我是solaris8的系统,上面也说了还不支持memstat这个命令。我是否还有其他的方法来了解这个参数那?

论坛徽章:
0
22 [报告]
发表于 2005-10-20 13:57 |只看该作者

请问用什么命令可以查看物理内存的占用情况?

这些内容理论上完全没有问题。但是配置完全相同,应用完全相同的2台或者几台服务器,就这台服务器内存占用大。如果按照这种原理来说,其他的服务器为什么内存没有给系统分配cache?\r\n\r\n文件系统IO大的情况下,才能被用做cache, 所以不同机器是有差异的。\r\n\r\n1.solaris系统是否会出现由于内存耗尽而down机的现象?\r\n\r\n任何系统都会因为内存耗尽而运转很慢,无法使用。\r\n\r\n2.这些现象报给sun,sun只是含糊的说系统可能遭到攻击或者有病毒存在。这种情况是否可能?\r\n\r\n当然不能排除,病毒几乎没有可能。受攻击可以查看进程和系统网络流量。\r\n\r\n但是,你的系统目前内存不紧张,sr列为0,意味着page scaner几乎没什么负载。\r\n\r\nvmstat -p 可以看看pgin pgout活动状态。看看pgin和out是在哪部分。\r\n\r\n\r\n最直观还是用 echo ::memstat | mdb -k\r\n\r\nsoalris 8上用这个命令,可以去下载这个文件:\r\n注意,这个文件不是SUN支持的,属于第三方提供,\r\n如果你的系统是生产系统,请小心使用!如果有实验机器,那最好先试一下。anyway,我不做任何保证!\r\n\r\n\r\n\r\nhttp://www.solarisinternals.com/si/downloads/memory.so\r\n\r\n\r\nwget http://www.solarisinternals.com/si/downloads/memory.so\r\n\r\ncp memory.so /usr/lib/mdb/kvm/sparcv9\r\n\r\nmdb -k\r\n>;::load memory\r\n>;::memstat

论坛徽章:
0
23 [报告]
发表于 2005-10-20 14:53 |只看该作者

请问用什么命令可以查看物理内存的占用情况?

终于出来来,这个包确实比较好使:)结果如下:\r\n\r\nbash-2.03# mdb -k\r\nLoading modules: [ unix krtld genunix ip nfs ptm logindmux ipc ]\r\n>; ::load memory\r\n>; ::memstat\r\nPage Summary                Pages                MB  %Tot\r\n------------     ----------------  ----------------  ----\r\nKernel                      29027               226    6%\r\nAnon                        33780               263    7%\r\nExec and libs                2928                22    1%\r\nPage cache                 292541              2285   58%\r\nFree (cachelist)           139783              1092   27%\r\nFree (freelist)             10425                81    2%\r\n\r\nTotal                      508484              3972\r\nPhysical                   501850              3920

论坛徽章:
0
24 [报告]
发表于 2005-10-20 15:08 |只看该作者

请问用什么命令可以查看物理内存的占用情况?

“当然,系统真正free的内存,是::memstat结果中的, \r\n\r\nFree (cachelist)   \r\nFree (freelist)       ”\r\n\r\n根据这个说法,我的系统free的内存是27%+2%=29%。也就是说系统内存占用率为70%。这个和vmstat结果计算出来的是一致的。(4-1.2)/4*100%=70%。\r\n\r\n从这个结果看,“Page cache”占用了58%,是占用最大的部分。这个内容实际的意思是什么那?针对于这几行的实际意义能解释一下吗?

论坛徽章:
0
25 [报告]
发表于 2005-10-21 10:46 |只看该作者

请问用什么命令可以查看物理内存的占用情况?

建议调节以下你的page的相应参数.

论坛徽章:
0
26 [报告]
发表于 2005-10-21 10:51 |只看该作者

请问用什么命令可以查看物理内存的占用情况?

有相关的文档介绍page这方面的吗?以前确实没有接触过,也不知道具体应该怎么调阿:(

论坛徽章:
0
27 [报告]
发表于 2005-10-21 10:55 |只看该作者

请问用什么命令可以查看物理内存的占用情况?

去SUN的网站上down一下有一个关于系统参数调整的文档.

论坛徽章:
0
28 [报告]
发表于 2005-10-21 12:40 |只看该作者

请问用什么命令可以查看物理内存的占用情况?

原帖由 \"yuanfly\"]tld genunix ip nfs ptm logindmux ipc  发表:\n\r\n>; ::load memory\r\n>; ::memstat\r\nPage Summary                Pages                MB  %Tot\r\n------------     ----------------  ----------------  ----\r\nKernel..........
\r\n\r\nPage cache                 292541              2285   58% \r\n\r\nPage cahe就是用于文件系统IO,文件内存映射的内存,同时也反映/tmp消耗的内存。这些内存如果被释放,就会变成Free (cachelist)。\r\n\r\n你近一半的内存都耗在这上面了,虽然导致的原因很多,我还是建议你先看看/tmp目录下文件的大小。\r\n\r\ndf -k 或者 df -h看看吧\r\n\r\n从你vmstat的结果看,你的系统内存目前并不紧张。

论坛徽章:
0
29 [报告]
发表于 2005-10-21 16:01 |只看该作者

请问用什么命令可以查看物理内存的占用情况?

Difference between freemem and availrmem:\r\n----------------------------------------\r\n\r\nAlthough both freemem and availrmem reports available pages, there is a\r\ndifference in what is considered available by freemem and availrmem.\r\n\r\nfreemem reports how much memory is immediately available for use. freemem\r\npages can be used with no more overhead than removing them from the\r\nfreelist or cachelist.\r\n\r\navailrmem, on the other hand, reports how much memory can be make available\r\nif the demand is there. It counts all the unmapped pages that can be freed.\r\nSome time it is not possible to free all unmapped pages. For\r\ne.g: Dirty pages tied up in the page cache (page cache is used to\r\ncache file system data) can not be freed immediately since these pages\r\nneed to be written to the backing store before they can be marked as free.\r\nFile system flush daemon, fsflush, is responsible for finding the modified\r\npages and pushing the modified data to the backing store. When the dirty\r\npages in the page cache are written to the backing store, pages are\r\nmoved to the cachelist. Pages on the cachelist are counted as free pages\r\nand are available for immediate use. \r\n\r\nThere are, however, few exceptions as listed below:\r\n\r\n- Setting the sticky bit on a file using chmod(1) will instruct the kernel\r\nto keep the file in memory (sticky - stick to memory). These pages won\'t be\r\nmoved to the cachelist even after being written to the backing store.\r\navailrmem would, however, still count these pages as available\r\n\r\n- Pages associated to files created in tmpfs file system will always be\r\ndirty since the pages are wired in memory with no backing store. Although\r\ntmpfs file pages are counted as part of page cache, these pages are not\r\ncounted as available by availrmem.

论坛徽章:
0
30 [报告]
发表于 2005-10-21 16:04 |只看该作者

请问用什么命令可以查看物理内存的占用情况?

原帖由 \"yuanfly\" 发表:\nDifference between freemem and availrmem:\r\n----------------------------------------\r\n\r\nAlthough both freemem and availrmem reports available pages, there is a\r\ndifference in what is considered availab..........
\r\n\r\n你的tmpfs是不是有大文件呢?
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP