`
netcome
  • 浏览: 467317 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

MSDN中关于Working Set的一些说明

阅读更多

*The working set of a process is the set of memory pages currently visible to the process in physical RAM memory. These pages are resident and available for an application to use without triggering a page fault. 
*The working set of a process consists of the set of resident physical pages visible to the process. When a thread accesses a page that is not in the working set of its process, a page fault occurs. Before the thread can continue, the virtual memory manager must add the page to the working set of the process. A larger working set increases the probability that a page will be resident in memory, and decreases the rate of page faults.

可以把Working Set看成一个进程可以用到(但不一定会使用)的物理内存(物理内存页的集合)。内存管理单元在进行虚拟内存地址到物理内存地址转换时,如果虚拟地址不在物理内存中,会引起page fault异常。足够的WorkingSet就可以保证常用的虚拟地址都位于物理内存中,减少这种异常,避免了异常处理(例如访问swap文件,将页面读入物理内存)带来的性能损耗。因此,对于时间比较敏感的程序,应该分配足够的WorkingSet以保证程序性能。
 
*When you increase the working set size of an application, you are taking away physical memory from the rest of the system.
*Suppose you have a 16-megabyte system and you set your minimum to four megabytes. In effect, this takes away four megabytes from the system. Other applications may be unable to get their minimum working set.

可见,Working Set是被真实地从物理内存中划分出来的。一个程序占用了多少Working Set,物理内存中就有多少空间不能被其它程序使用。
 
*Reducing memory consumption is always a beneficial goal. If you call SetProcessWorkingSetSize(0xffffffff, 0xffffffff), this tells the system that your working set can be released. This does not change the current sizing of the working set, it just allows the memory to be used by other applications. It is a good idea to do this when your application goes into a wait state. 
*Windows NT 3.5 allows processes to increase their working set size by using SetProcessWorkingSetSize(). This API is also useful to trim your minimum working set size if you want to run many processes at once, because each process has the default minimum working set size reserved, no matter how small the process actually is.

Windows会为每个进程保留一个默认数值的working set,然而这个保留的Working set可能会比该process实际需要的大。可以用SetProcessWorkingSetSize()来对进程的Working set进行裁剪,只保留进程目前已经占用的页面,空闲的就释放掉给其它应用使用。

分享到:
评论

相关推荐

    MSDN中关于CString类成员函数的说明

    MSDN中关于CString类成员函数的说明

    MSDN帮助文档中文.zip

    最新MSDN帮助文档中文版 离线包,自己存储使用 最新MSDN帮助文档中文版 离线包,自己存储使用 最新MSDN帮助文档中文版 离线包,自己存储使用 小白方便查看

    MFC MSDN中文帮助

    MFC MSDN中文帮助 VC++,介绍vc++开发中的windows API,是vc++开发不可缺少的工具

    msdn_中C#__正则 说明基础文档

    msdn_中C#__正则 说明基础文档 各种符号说明

    MSDN中所有MFC实例

    MSDN中所有MFC实例 MSDN中所有MFC实例

    MSDN 中文在线书籍

    下载自http://www.microsoft.com/taiwan/msdn/library/default.htm 的四本 MSDN 中文在线书籍,已整理制作为 CHM 文件。

    中文版本MSDN

    汉化了MSDN中的一些函数的说明。

    MSDN中文帮助手册

    本手册是真正的中文开发手册,来自于官网,适合初学者,开发人员查询使用

    MSDN中d3d的中文翻译

    微软MSDN中D3D部分的中文翻译。来源自gameres.com,感谢他们为普及游戏编程、设计方面做出的杰出贡献。

    MSDN 中文在线书籍.chm

    MSDN 中文在线书籍.chm

    1、MSDN(C#).pdf

    C#帮助文档MSDN文档(英文版)

    MSDN中文库

    涉及到的内容有cppreference.chm、c与c++标准类库及函数.chm、MFC类库详解.chm、TeeChart+for+.Net中文版.chm、MFC类库详解.chm、Win32API大全+(中文版)、WinAPI_VB.CHM,平常开发过程中可进行查阅。

    MSDN中的计算器源代码

    MSDN中的计算器源代码,微软做的,仅供参考

    MSDN中文版

    MSDN中文版,还有一些windows32的API详解,是编程的必备参考资料。 MSDN中文版,还有一些windows32的API详解,是编程的必备参考资料。

    VC++6.0 MSDN.zip-中文-英文

    MSDN只是一个参考技术大全,对于开发人员来说是非常有用的。里面有很详细的各个函数,API等的具体语法及用法举例。可以用于查看C库函数的用法等 英文的里面的函数以及资料都要全一些,中文虽然易看懂但是函数就相对...

    MSDN 中的图形元素和文档约定

    MSDN 中的图形元素和文档约定:类、接口、结构、委托、枚举等。 只是一张图片。表示类等在msdn中的表示。

    MSDN中所有MFC例子源代码

    里面有MSDN中所有MFC例子源代码,都是经典啊。

    Visual Studio 2008 中的 MSDN Library 安装问题

    Visual Studio 2008 中的 MSDN Library 安装问题

    MSDN2005绿色便携版MSDN

    首先声明,这份资源是amo_xoo的毛哥.NET 2.0便携参考(绿色MSDN) 2.0 彻底版,但他那个分了9个包,下载起来很不方便,所以就引用过来,方便大家下载。 微软MSDN在线库虽然全,但有时不方便上网,而MSDN Library安装...

Global site tag (gtag.js) - Google Analytics