- 论坛徽章:
- 0
|
请问用什么命令可以查看物理内存的占用情况?
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. |
|