谁能把ProcessExplorer里面的各种进程内存信息解释清楚?

superdiablo 2007-12-27 07:23:25
我想看一个进程是否有内存泄漏,开始是观察ProcessExplorer里面的WorkingSet,后来发现这个不准确,因为它是物理内存(具体指真正用到的字节数还是页面总共的字节数不清楚),会乱变。查网上,有人说Private Bytes是程序自己分配的,已经提交了的总字节数,且不包含共享内存,这个似乎是我想要的了,可是我发现就算程序处于Idle状态,它也会变化几个字节,按道理它应该只有在我进行操作的时候变化才对。其他的参数Virtual Size, WS Private, WS Sharable and WS shared我也没有找到明确的说明。它们的关系我计算了一下,仅仅有一个确定的:WorkingSet=WS Private+WS Sharable。
有没有人对这些参数的物理意义比较清楚,它们的关系如何?

另外不要告诉我用其他方法查内存泄漏,其他方法我了解,我就想知道这几个参数的意义和关系。
...全文
781 11 打赏 收藏 转发到动态 举报
写回复
用AI写文章
11 条回复
切换为时间正序
请发表友善的回复…
发表回复
Torch009 2008-01-03
  • 打赏
  • 举报
回复
up
superdiablo 2007-12-29
  • 打赏
  • 举报
回复
做了一下实验,基本搞清楚了。private bytes算是比较理想的一个参数吧。谢谢各位参与,蒋老大都来了;-) 过几天结贴。
oldmanzhao 2007-12-28
  • 打赏
  • 举报
回复
想问一下老大,MVP被微软雇用的多吗?或者说是不是MVP被微软雇用的可能会大一点呢?
蒋晟 2007-12-28
  • 打赏
  • 举报
回复
MVP人数太少,没有统计学意义。
jameshooo 2007-12-28
  • 打赏
  • 举报
回复
等蒋晟再来回答吧。

我既不想做微软员工,也不想做MVP,说不定某个时候就离开CSDN了,也说不定以后转行不再搞软件。
蒋晟 2007-12-27
  • 打赏
  • 举报
回复
MVP在被微软雇用的时候就失去MVP资格
想查内存泄漏的话,可以自己写内存分配和释放程序,比如MFC的DEBUG_NEW。一些程序会自己分配一个堆,虽然堆上的内存没有被程序的代码使用,但是还是被程序预留了。.Net程序的堆比Visual C++的堆要大,但是一个进程内的所有模块共享一个托管堆,而且GC会避免内存泄漏的问题,但是还没被GC的程序不再使用的对象也会占内存。
如果你要检查内存泄漏,你应该重视private bytes和virtual bytes。如果你的程序的内存页交换太多,你应该检查Working Set。
顺便说一下,你应该用performance monitor来监视性能。你也可以用一个profiler或者注入一个DLL来hook virtualalloc。
jameshooo 2007-12-27
  • 打赏
  • 举报
回复
那是每年一度的开发者大会。
我也没想到这么快会变星星
superdiablo 2007-12-27
  • 打赏
  • 举报
回复
哎,一天不见你成星星了?进化的快啊,呵呵
据我所知,微软的员工也可以成为MVP。蒋晟有次不是说他跟Bill Gates开会吗?
jameshooo 2007-12-27
  • 打赏
  • 举报
回复
顶。这个问题我也回答不了,但有一点,MVP都不是微软员工,所以蒋晟也不是,呵呵
superdiablo 2007-12-27
  • 打赏
  • 举报
回复
谢谢楼上,我正试着找地方下载Sysinternals Video Library,6DVD太大了,也不知道能不能在里面找到答案。

刚去SysInternal的网站上查,这个问题好像在那里也是个一直得不到回答而又经常被问的问题。是不是只有微软的人,比如蒋晟才能回答,呵呵。
http://forum.sysinternals.com/forum_posts.asp?TID=11289

Topic: Process Explorer - App Memory Consumption
Posted: 03 July 2007 at 4:10am
Hello,

I trying to figure out the memory consumption of my running application using the Process Explorer v10.21.
But I feel that the help it provides is lucking some info.

Can you forward me where I can find a detailed description of the columns of the Process Explorer main window or send my data about it?

The main fields I need to be more familiar with are:
* Private Bytes
* Virtual Size
* Heap Bytes

Does the value of any of them are included in the value of the other?


-----
Thanks
Sharon


Hi, Sharon.

This type of inquiry comes up from time to time. Unfortunately, though it has been discussed I am not aware of any complete comparison or description of the values that Process Explorer or other tools are able to display.

For Virtual Size, the following topic, as well as the link in it, may prove useful:
"Virtual Memory"

For Private Bytes, Microsoft Windows Internals, Fourth Edition states:
the Process: Page File Bytes performance counter is actually the total process private committed memory, of which none, some, or all may be in the paging file. (In fact, it's the same as the Process: Private Bytes performance counter.)


The PE Help File states:
Private Bytes represents the amount of private virtual memory a process has allocated and is the value that will rise of a process exhibiting a memory leak bug.


For Heap Bytes - not sure what you are referring to - the .NET CLR Memory performance counter for "# Bytes in all Heaps"? Per MSDN:
Displays the sum of the Gen 0 Heap Size, Gen 1 Heap Size, Gen 2 Heap Size, and the Large Object Heap Size counters. This counter indicates the current memory allocated in bytes on the garbage collection heaps.


Hope this helps...


Edited by molotov - 03 July 2007 at 5:17am
Daily affirmation:
net helpmsg 4006

mygreenpaste.blogspot.com
DentistryDoctor 2007-12-27
  • 打赏
  • 举报
回复
推荐的资料:
Sysinternals Video Library
网管教程 从入门到精通软件篇 ★一。★详细的xp修复控制台命令和用法!!! 放入xp(2000)的光盘,安装时候选R,修复! Windows XP(包括 Windows 2000)的控制台命令是在系统出现一些意外情况下的一种非常有效的诊断和测试以及恢复系统功能的工具。小编的确一直都想把这方面的命令做个总结,这次辛苦老范给我们整理了这份实用的秘笈。   Bootcfg   bootcfg 命令启动配置和故障恢复(对于大多数计算机,即 boot.ini 文件)。   含有下列参数的 bootcfg 命令仅在使用故障恢复控制台时才可用。可在命令提示符下使用带有不同参数的 bootcfg 命令。   用法:   bootcfg /default  设置默认引导项。   bootcfg /add    向引导列表中添加 Windows 安装。   bootcfg /rebuild  重复全部 Windows 安装过程并允许用户选择要添加的内容。   注意:使用 bootcfg /rebuild 之前,应先通过 bootcfg /copy 命令备份 boot.ini 文件。   bootcfg /scan    扫描用于 Windows 安装的所有磁盘并显示结果。   注意:这些结果被静态存储,并用于本次会话。如果在本次会话期间磁盘配置发生变化,为获得更新的扫描,必须先重新启动计算机,然后再次扫描磁盘。   bootcfg /list   列出引导列表中已有的条目。   bootcfg /disableredirect 在启动引导程序中禁用重定向。   bootcfg /redirect [ PortBaudRrate] |[ useBiosSettings]   在启动引导程序中通过指定配置启用重定向。   范例: bootcfg /redirect com1 115200 bootcfg /redirect useBiosSettings   hkdsk   创建并显示磁盘的状态报告。Chkdsk 命令还可列出并纠正磁盘上的错误。   含有下列参数的 chkdsk 命令仅在使用故障恢复控制台时才可用。可在命令提示符下使用带有不同参数的 chkdsk 命令。   vol [drive:] [ chkdsk [drive:] [/p] [/r]   参数  无   如果不带任何参数,chkdsk 将显示当前驱动器中的磁盘状态。 drive: 指定要 chkdsk 检查的驱动器。 /p   即使驱动器不在 chkdsk 的检查范围内,也执行彻底检查。该参数不对驱动器做任何更改。 /r   找到坏扇区并恢复可读取的信息。隐含着 /p 参数。   注意 Chkdsk 命令需要 Autochk.exe 文件。如果不能在启动目录(默认为 %systemroot%System32)中找到该文件,将试着在 Windows 安装 CD 中找到它。如果有多引导系统的计算机,必须保证是在包含 Windows 的驱动器上使用该命令。 Diskpart   创建和删除硬盘驱动器上的分区。diskpart 命令仅在使用故障恢复控制台时才可用。   diskpart [ /add |/delete] [device_name |drive_name |partition_name] [size]   参数 无   如果不带任何参数,diskpart 命令将启动 diskpart 的 Windows 字符模式版本。   /add   创建新的分区。   /delete   删除现有分区。   device_name   要创建或删除分区的设备。设备名称可从 map 命令的输出获得。例如,设备名称:   DeviceHardDisk0   drive_name   以驱动器号表示的待删除分区。仅与 /delete 同时使用。以下是驱动器名称的范例:   D:   partition_name   以分区名称表示的待删除分区。可代替 drive_name 使用。仅与 /delete 同时使用。以下是分区名称的范例:   DeviceHardDisk0Partition1    大小   要创建的分区大小,以兆字节 (MB)表示。仅与 /add 同时使用。   范例   下例将删除分区: diskpart /delete Device HardDisk0 Partition3 diskpart /delete F:   下例将在硬盘上添加一个 20 MB 的分区:   diskpart /add Device HardDisk0 20   Fixboot

15,471

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 进程/线程/DLL
社区管理员
  • 进程/线程/DLL社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧