“女士用法"高于"VM Size"在WinXP Task Manager中 [英] "Mem Usage" higher than "VM Size" in WinXP Task Manager

查看:76
本文介绍了“女士用法"高于"VM Size"在WinXP Task Manager中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Windows XP任务管理器中,某些进程在内存使用情况"列中显示的值大于VMSize.以我的Firefox实例为例,它显示的内存使用量为111544 K,VMSize显示为100576K.

In my Windows XP Task Manager, some processes display a higher value in the Mem Usage column than the VMSize. My Firefox instance, for example shows 111544 K as mem usage and 100576 K as VMSize.

根据任务管理器内存使用情况"的帮助文件,该进程是工作集,而VMSize是虚拟地址空间中的已提交内存.

According to the help file of Task Manager Mem Usage is the working set of the process and VMSize is the committed memory in the Virtual address space.

我的问题是,如果一个进程的已提交页面数是A,而同一进程的物理内存中的页面数是B,那么它是否不总是B≤A?每个进程的物理内存中的页面数量不是已提交页面的子集吗?

My question is, if the number of committed pages for a process is A and the number of pages in physical memory for the same process is B, shouldn't it always be B ≤ A? Isn't the number of pages in physical memory per process a subset of the committed pages?

这是否与进程之间的内存共享有关?请解释. (也许我对工作集"的定义不合时宜.)

Or is this something to do with sharing of memory among processes? Please explain. (Perhaps my definition of 'Working Set' is off the mark).

谢谢.

推荐答案

虚拟内存

假设您的程序(例如Oracle)在启动时分配了100 MB的内存-您的VM大小增加了100 MB,尽管未触及其他物理/磁盘页面.也就是说,VM只是存储簿记.

Assume that your program (eg Oracle) allocated 100 MB of memory upon startup - your VM size goes up by 100 MB though no additional physical / disk pages are touched. ie VM is nothing but memory book keeping.

总可用物理内存+分页文件内存是系统中所有进程可以分配的最大内存.系统这样做是为了确保在任何时候,如果进程实际上开始消耗它分配给OS的所有内存,便可以提供所需的实际物理页.

The total available physical memory + paging file memory is the maximum memory that ALL the processes in the system can allocate. The system does this so that it can ensure that at any point time if the processes actually start consuming all that memory it allocated the OS can supply the actual physical pages required.

私有内存

如果程序将10 MB的数据复制到该100 MB中,则OS会感觉到没有页面分配给与那些地址相对应的进程,并将价值10 MB的物理页面分配到了进程的私有内存中. (此过程称为页面错误)

If the program copies 10 MB of data into that 100 MB, OS senses that no pages have been allocated to the process corresponding to those addresses and assigns 10 MB worth of physical pages into your process's private memory. (This process is called page fault)

工作集

定义:工作集是程序最近触及的一组内存页面.

Definition : Working set is the set of memory pages that have been recently touched by a program.

这时,将这10页添加到流程的工作集中.如果随后执行该过程并将该数据复制到先前分配的另一个10 MB缓存中,则其他所有内容均保持不变,但是如果这些旧页面不在工作集中,则工作集将再次增加10 Mb.但是,如果那些页面已经在工作集中,那么一切都很好,并且程序的工作集保持不变.

At this point these 10 pages are added to the working set of the process. If the process then goes and copies this data into another 10 MB cache previously allocated, everything else remains the same but the Working Set goes up again by 10 Mb if those old pages where not in the working set. But if those pages where already in the working set, then everything is good and the programs working set remains the same.

工作方式行为

想象一下,您的进程再也不会触及前10个页面,在这种情况下,这些页面将从您的进程的工作集中删除,并有可能发送到页面文件中,以便操作系统可以引入其他更常用的页面.但是,如果没有紧迫的低内存需求,则无需执行这种分页操作,并且OS可以充当其丰富的内存.在这种情况下,工作集只是让这些页面保留.

Imagine your process never touches the first 10 pages ever again, in which case these pages are trimmed off from your process's working set and possibly sent to the page file so that the OS can bring in other pages that are more frequently used. However if there are no urgent low memory requirements, then this act of paging need not be done and OS can act as if its rich in memory. In this case the working set simply lets these pages remain.

何时使用工作集>虚拟内存

现在想象同一个程序会释放所有100 Mb的内存.程序VM的大小立即减少了100 MB(记住VM =记录所有内存分配请求)

Now imagine the same program de-allocates all the 100 Mb of memory. The programs VM size is immediately reduced by 100 MB (remember VM = book keeping of all memory allocation requests)

工作集无需受此影响,因为这不会改变最近触摸过的那10 Mb页面的事实.因此,尽管操作系统可以在需要时回收这些页面,但这些页面仍保留在该过程的工作集中.

The working set need not be affected by this, since that doesn't change the fact that those 10 Mb worth of pages where recently touched. Therefore those pages still remain in the working set of the process though the OS can reclaim them whenever it requires.

这将有效地使VM<工作集.但是,如果您启动另一个消耗更多内存的进程,并且OS回收了工作集页面,这将纠正.

This would effectively make the VM < working set. However this will rectify if you start another process that consumes more memory and the working set pages are reclaimed by the OS.

这篇关于“女士用法"高于"VM Size"在WinXP Task Manager中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆