Windows 任务管理器中的“VM 大小”是什么意思?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/27407/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
What does "VM Size" mean in the Windows Task Manager?
提问by Jonas Pegerfalk
Virtual memory from a computer size perspective is
从计算机大小的角度来看,虚拟内存是
[a way to make the program] think it has a large range of contiguous addresses; but in reality the parts it is currently using are scattered around RAM, and the inactive parts are saved in a disk file. (Wikipedia)
【一种使程序的方法】认为它有很大范围的连续地址;但实际上它当前使用的部分分散在 RAM 中,不活动的部分保存在磁盘文件中。(维基百科)
I would interpret VM Size in the Windows Task manager as either the total addressable virtual memory space or the amount of memory the process is currently using in the virtual memory space.
我会将 Windows 任务管理器中的 VM 大小解释为总可寻址虚拟内存空间或进程当前在虚拟内存空间中使用的内存量。
But in the Task Manager the WM Size is in many cases less than Mem Usage, which should be amount of RAM the process is using. Therefor I guess that WM Size means something else?
但是在任务管理器中,WM 大小在许多情况下小于内存使用量,这应该是进程正在使用的 RAM 量。因此,我猜 WM 大小意味着其他什么?
回答by Suma
It's the total of all private (not shared) bytes allocated by this process, whether currently in physical memory or not.
它是此进程分配的所有私有(非共享)字节的总数,无论当前是否在物理内存中。
See also An introductory guide to Windows Memory Managementor Commit Charge Wikipedia article
另请参阅Windows 内存管理或提交费用 Wikipedia 文章的介绍性指南
For a developer watching process state like this I would recommend to install SysInternals Process Explorerand to use it instead of the default Task Manager. This value is called "Private Bytes" in it.
对于像这样观察进程状态的开发人员,我建议安装SysInternals Process Explorer并使用它而不是默认的任务管理器。该值在其中称为“私有字节”。
回答by Simon Kim
What's the correct answer about VM Size?
关于 VM 大小的正确答案是什么?
In Coding Horror
How much of the processes' less frequently used memory has been paged to disk.
In Comment of Coding Horror
You're wrong on VM Size. It's the total of all private (not shared) bytes allocated by this process, whether currently in physical memory or not. It's a better value for tracking whether you have a memory leak than 'Mem Usage'. The same value is available in Performance Monitor as 'Process: Private Bytes'.
In MSDN
Virtual Memory Size : The amount of virtual memory, or address space, committed to a process.
在编码恐怖
有多少进程不常用的内存已被分页到磁盘。
在评论编码恐怖
您在 VM 大小上错了。它是此进程分配的所有私有(非共享)字节的总数,无论当前是否在物理内存中。与“内存使用情况”相比,跟踪是否存在内存泄漏更有价值。Performance Monitor 中的值与“Process: Private Bytes”相同。
在 MSDN
虚拟内存大小:提交给进程的虚拟内存或地址空间的数量。
I am confusing what is corrent.
我很困惑什么是正确的。
回答by Ted Percival
The amount of memory mapped into that process' address space. This can include shared memory mappings.
映射到该进程地址空间的内存量。这可以包括共享内存映射。
In a process there will be sections of the memory space for each shared object (DLL) that is part of it, as well as some memory for stack, and areas allocated by the process itself.
在一个进程中,每个共享对象 (DLL) 都会有一部分内存空间作为它的一部分,还有一些用于堆栈的内存,以及由进程本身分配的区域。
For example looking at the memory map of a cat
command on my system I can see its memory mappings. In this case I use cat /proc/self/maps
to investigate the cat process itself. Mapped into its virtual memory is the binary itself, some heap, locale information, libc (with various permission flags), ld.so (the dynamic linker), stack, vdso and vsyscall sections and some anonymous mappings (mapped pages with no backing file).
例如,查看cat
我系统上某个命令的内存映射,我可以看到它的内存映射。在这种情况下,我cat /proc/self/maps
用来调查 cat 进程本身。映射到其虚拟内存的是二进制文件本身、一些堆、区域设置信息、libc(具有各种权限标志)、ld.so(动态链接器)、堆栈、vdso 和 vsyscall 部分以及一些匿名映射(映射页面,没有支持文件)。
00400000-00408000 r-xp /bin/cat
00607000-00608000 rw-p /bin/cat
008ac000-008cd000 rw-p [heap]
7fbd54175000-7fbd543cf000 r--p /usr/lib/locale/locale-archive
7fbd543cf000-7fbd54519000 r-xp /lib/libc-2.7.so
7fbd54519000-7fbd54718000 ---p /lib/libc-2.7.so
7fbd54718000-7fbd5471b000 r--p /lib/libc-2.7.so
7fbd5471b000-7fbd5471d000 rw-p /lib/libc-2.7.so
7fbd5471d000-7fbd54722000 rw-p
7fbd54722000-7fbd5473e000 r-xp /lib/ld-2.7.so
7fbd5491d000-7fbd5491f000 rw-p
7fbd5493a000-7fbd5493d000 rw-p
7fbd5493d000-7fbd5493f000 rw-p /lib/ld-2.7.so
7fff5c929000-7fff5c93e000 rw-p [stack]
7fff5c9fe000-7fff5c9ff000 r-xp [vdso]
ffffffffff600000-ffffffffff601000 r-xp [vsyscall]
For each mapping, subtract the start address from the end address to determine its size, for example the [stack]
line: 0x7fff5c9ff000 - 0x7fff5c9fe000 = 0x1000
. In decimal, 4096 bytes - a 4 kiB stack.
对于每个映射,从结束地址中减去开始地址以确定其大小,例如[stack]
行:0x7fff5c9ff000 - 0x7fff5c9fe000 = 0x1000
。十进制,4096 字节 - 4 kiB 堆栈。
If you add up all these figures, you'll get the process' virtual memory (VM) size.
如果将所有这些数字相加,您将获得进程的虚拟内存 (VM) 大小。
VM size is not a reliable way to determine how much memory a process is using. For instance there will only be one copy of each of the read-only /lib/libc-2.7.so
maps in physical memory, regardless of how many processes use it.
VM 大小不是确定进程使用多少内存的可靠方法。例如/lib/libc-2.7.so
,无论有多少进程使用它,物理内存中的每个只读映射都只有一个副本。
回答by Derek Swingley
How about a coding horror post to answer this: http://www.codinghorror.com/blog/archives/000393.html
一个编码恐怖帖子如何回答这个问题:http: //www.codinghorror.com/blog/archives/000393.html
"VM Size: How much of the processes' less frequently used memory has been paged to disk."
“VM 大小:有多少进程不常使用的内存已被分页到磁盘。”
回答by Lewis
I can't see VM size in the Windows task manager, Whatup Gold has a VM size in its task manager - do you mean that? in this case i beleive it relates to the total amount available to the VM
我在 Windows 任务管理器中看不到 VM 大小,Whatup Gold 在其任务管理器中有一个 VM 大小 - 你是这个意思吗?在这种情况下,我相信它与 VM 可用的总量有关