Working set和Private bytes区别
来源:互联网 发布:查询域名是否备案 编辑:程序博客网 时间:2024/06/01 23:50
在Performance monitor中可以通过private bytes和Virtual bytes来衡量程序的内存使用. 在task manager中, 也有Memory Usage和VM Size两项. 但是仔细比较后会发现Memory Usage并不是对应private bytes, VM Size也不是对应Virtual Bytes.
其实,
Working Set和Private Bytes
==============
一个有趣的问题是, working set指目前程序所消耗的物理内存, private bytes值commit的内存, 那么为什么有些进程的working set比private bytes还大? 要回答这个问题, 需要仔细看看两者的定义:
- "Working Set refers to the numbers of pages of virtual memory committed to a given process, both shared and private."
- "Private Bytes is the current size, in bytes, of memory that this process has allocated that cannot be shared with other processes."
所以, Working Set包含了可能被其他程序共享的内存, 而Private Bytes只包括被当前进程使用的内存.
DLL是一个典型的可能被其他程序共享的资源. DLL的加载使用文件映像, 因此包含DLL的物理内存可以被同时映像到多个进程上. 所以在进程中加载DLL的内存只能算到working set上, 而不能被算到private bytes上.
2010年4月15日更新:
在解决内存问题的时候Shared的部分一般可以不用考虑.
一个进程使用内存的时候, 它占用的内存会被分为两部分, 一部分是working set, 另一部分是private byte减去working set. 其中working set是贮存在物理内存中的, 而另一部分是paging file, 存在磁盘上.
一般来说把所有进程的working set加起来会比你机器上所拥有的物理内存要大, 这是因为有Shared的资源(比如DLL)的缘故.
关于Working Set, Virtual Bytes, Private Byte的概念
Working Set- Working Set is the current size, in bytes, of the Working Set of this process. The Working Set is the set of memory pages touched recently by the threads in the process. If free memory in the computer is above a threshold, pages are left in the Working Set of a process even if they are not in use. When free memory falls below a threshold, pages are trimmed from Working Sets. If they are needed they will then be soft-faulted back into the Working Set before leaving main memory.
Virtual Bytes- Virtual Bytes is the current size, in bytes, of the virtual address space the process is using. Use of virtual address space does not necessarily imply corresponding use ofeither disk or main memory pages. Virtual space is finite, and the process can limit its ability to load libraries.
Private Bytes- Private Bytes is the current size, in bytes, of memory that this process has allocated that cannot be shared with other processes.
=======================================
Private Bytes
Working Set
Virtual Bytes
- Working set和Private bytes区别
- Working set和Private bytes区别
- Working Set,Private Bytes 区别
- private bytes working set virtual bytes
- Windows中的进程的Working Set,Private Bytes和Virtual Bytes
- Windows中的进程的Working Set,Private Bytes和Virtual Bytes
- Windows中的进程的Working Set,Private Bytes和Virtual Bytes
- Windows中的进程的Working Set,Private Bytes和Virtual Bytes
- Windows中的进程的Working Set,Private Bytes和Virtual Bytes (2015-09-24 14:32:23)
- process explorer中的visual size vs working set; private bytes vs WS private
- What is the working set, commit, and private working set memory size?
- 创建ndk_builder勾选和不勾选specify working set of relevant resources区别
- 你真的懂任务管理器中有关内存的参数Private(提交大小)和working set(工作设置)吗?
- 你真的懂任务管理器中有关内存的参数Private(提交大小)和working set(工作设置)吗?
- 你真的懂任务管理器中有关内存的参数Private(提交大小)和working set(工作设置)吗?
- eclipse的workspace和working set
- Bytes和bits有何区别
- private和protected继承区别
- centos7.2 下为erlang添加lager日志框架
- windows程序设计之简单界面入门
- Java中的多线程
- 日常问题(一)——Tomcat定制或取消定制JDK路径
- 今日即将更新芝麻分!来看看支付宝芝麻分500以上用户的福利!
- Working set和Private bytes区别
- PHP安全编程:防止SQL注入
- 2.2 Ubuntu下安装Android Studio
- windowsoracle安装时问题
- eclipse 打war包后运行时报 cas.client 错误
- STL中部分常用的方法
- 第八章 管理支付和订单
- ES2017 标准引入了 async 函数
- 详细图解MySQL5.7(win7x64 5.7.16版本)下载、安装、配置与使用