• 软件测试技术
  • 软件测试博客
  • 软件测试视频
  • 开源软件测试技术
  • 软件测试论坛
  • 软件测试沙龙
  • 软件测试资料下载
  • 软件测试杂志
  • 软件测试人才招聘
    暂时没有公告

字号: | 推荐给好友 上一篇 | 下一篇

核心参数 swapmem_on 的作用

发布: 2007-6-08 22:43 | 作者: seanhe | 来源: ChinaUnix.net

软件测试论坛讨论

领测软件测试网
以及它的具体解释(Allow Memory to Exceed Swap Space)
如果设为1,是可以申请更多的空间作为swap空间,还是可以使用swap空间

 wdbj 回复于:2003-02-25 10:20:41
swapmem_on 
swapmem_on enables pseudo-swap reservation.

Acceptable Values:
Minimum 
0 (disable pseudo-swap reservation) 
Maximum 
1 (enable pseudo-swap reservation) 
Default 

Specify integer value of 0 or 1. For more information, see Specifying Parameter Values.

Description
swapmem_on enables or disables the reservation of pseudo-swap, which is space in system memory considered as available virtual memory space in addition to device swap space on disk. By default, pseudo-swap is enabled.

Virtual memory (swap) space is normally allocated from the device swap area on system disks. However, on systems that have massive amounts of installed RAM and large disks or disk arrays, there may be situations where it would be advantageous to not be restricted to the allocated device swap space.

For example, consider an administrator running a system in single-user mode that has 200 Mbytes of installed RAM, only 20 Mbytes of which is used by the kernel, and 1 Gbyte of swap area on the root disk array.

Suppose a process is running that requires 1.1 Gbytes of swap space.

Since no other users have processes running on the system, providing access to the unused RAM by the swap system would provide sufficient swap space. swapmem_on accomplishes this.

Administrators of workstations and smaller systems may prefer to disable this capability, depending on system and user needs.

Related Parameters
None.

Additional Information
Overview of paging parameters 
List of paging parameters 
Browse configurable kernel parameters help

 hpux 回复于:2003-02-25 14:48:08
swap区的作用,大家理解起来应该没有问题:就是在系统可用内存不足时,用硬盘空间来存放空闲的内存块!但是,记住一点,启用swap区以后,并不说明系统因为启用了swap空间而效率提升;相反,这种事件的发生说明系统内存开始不足,系统效能开始下降!swap区的效率永远低于物理内存效率。
HP-UX启动每一个进程,都需要在swap区预留一块和内存一样大小的区域,以防内存不够时作数据交换。当预留的swap区用完时,系统就不能再启动新的进程。比如,系统物理内存是4G,而设置的交换区只有1G,那么可以计算得出大概3G的内存会浪费(Buffer Cache除外,可能有2G浪费)。
swapmen_on的作用,就是让系统创建一个pseudo-swap(伪交换区),大小为系统物理内存的3/4,但是这个伪交换区并不占用任何内存和硬盘资源。只是说,让系统认为,交换区的大小是1+4*3/4=4G,而不是1G,就是说可以启动更多的进程,避免内存的浪费。
一般系统物理内存不大的时候,设置交换区是物理内存的2-4倍,swapmen_on设置为1或0都没什么影响,但是当系统内存很大如8G时,因为swap一般不设为16G-32G,这时开启swapmen_on就很必要了。

 josephxd 回复于:2003-02-25 16:39:21
精華!

 playboy 回复于:2003-02-25 20:26:22
多谢楼上的兄弟!
另外有疑问:
在HP上,如果swap空间没有使用,则vmstat显示的memory的free项是指实际物理内存所剩空间吗?
如果swap空间已经投入数据交换,则是否说明物理内存已经100%的使用了,vmstat显示的memory的free项是申请的swap空间的剩余量??

延伸阅读

文章来源于领测软件测试网 https://www.ltesting.net/


关于领测软件测试网 | 领测软件测试网合作伙伴 | 广告服务 | 投稿指南 | 联系我们 | 网站地图 | 友情链接
版权所有(C) 2003-2010 TestAge(领测软件测试网)|领测国际科技(北京)有限公司|软件测试工程师培训网 All Rights Reserved
北京市海淀区中关村南大街9号北京理工科技大厦1402室 京ICP备10010545号-5
技术支持和业务联系:info@testage.com.cn 电话:010-51297073

软件测试 | 领测国际ISTQBISTQB官网TMMiTMMi认证国际软件测试工程师认证领测软件测试网