- 论坛徽章:
- 0
|
是否可以这样理解,用lsps -s命令看到的used%的量并不能真实的反映当前paging space中实际使用的虚拟内存页数,因为当中有存在”曾经被换出来的内存页又被换回去了,这个时候换页区的空间并不会被释放“ 这个情况,但真正使用多少是没有命令可以直接看到的!
从 lsps 的 manpage 来看,作者对 “allocated (reserved)” 和 “assigned (used)” 还是做了区分。
按照里面的讲法,除了 -s 以外的参数(比如 -a)都不会报告 reserved but not used 的那部分 ( in the case of PSALLOC=early ),就是被 pre-allocated (预分)的,但没有实际使用的。
而 -s 报告的百分比却是包括了那个部分:
Note: Setting the environment variable PSALLOC=early causes the use of early paging
space algorithm. In this case, the value the -s flag specifies is different from the value returned for a single paging space or when using
the -a flag for all the paging spaces. The value the -s flag displays is the percentage of paging space allocated (reserved), whether the
paging space has been assigned (used) or not. Therefore, the percentage reported by the -s flag is usually larger than that reported by the
-a flag when PSALLOC is set to early.
我做一个测试,证明了这段描述是确切的:
程序 'tc' malloc 1GB 空间,我的 paging space 是 3GB
- # PSALLOC=early ./tc &
- # lsps -a
- Page Space Physical Volume Volume Group Size %Used Active Auto Type
- hd6 hdisk0 rootvg 3584MB 1 yes yes lv
- # lsps -s
- Total Paging Space Percent Used
- 3584MB 30%
复制代码
如果不用 "PSALLOC=early",s 就和 -a 一样显示 1%。
我觉得 -s 和 -a 都有各自的参考价值。
至于 ”曾经被换出来的内存页又被换回去了,这个时候换页区的空间并不会被释放“ 这个情况,我不知道有什么简单的办法区别出来,因为它已经算在 “assigned (used)” 里了。
也许 ' comp + paging - avm ' 就等于这部分内存。 实际情况中应该不需要分的这么清楚吧 ??
或者直接理解为avm包括comp内存页和paging space中实际使用的内存页
是。
可以这么讲:avm 是真正意义上的工作内存使用总量,其中有些’页‘占用物理内存,有些’页‘占用或预留了换页区,有些’页‘两边都用(但它们在 avm 里也只计一次)。 |
|