为什么 Process.WorkingSet >进程最大工作集?
无聊的好奇心......
我正在查看当前进程的一些属性:
using(Process p = Process.GetCurrentProcess())
{
// Inspect properties
// p.MaxWorkingSet = 1,413,120
// p.MinWorkingSet = 204,800
// p.WorkingSet = 54,140,928
// p.WorkingSet64 = 54,140,928
}
从我阅读的文档来看,这些属性都与工作集大小(以字节为单位)相关,因此我期望看到:
MinWorkingSet <= WorkingSet <= MaxWorkingSet
这不是案例,谁能解释一下为什么?
Idle curiosity...
I'm looking at some of the properties of the current process:
using(Process p = Process.GetCurrentProcess())
{
// Inspect properties
// p.MaxWorkingSet = 1,413,120
// p.MinWorkingSet = 204,800
// p.WorkingSet = 54,140,928
// p.WorkingSet64 = 54,140,928
}
From my reading of the documentation, these properties are all related to the working set size in bytes, hence I was expecting to see:
MinWorkingSet <= WorkingSet <= MaxWorkingSet
This is not the case, can anyone explain why?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
MaxWorkingSet 和 MinWorkingSet 是 Win32 API GetProcessWorkingSetSize 返回的值。这些是虚拟管理器使用的限制,当内存供应不足时将强制执行。只要有足够的内存可用,当前工作集大小就可以增长到大于 MaxWorkingSet 中的值。
MaxWorkingSet and MinWorkingSet are the values returned by the Win32 API GetProcessWorkingSetSize. These are limits used by the virtual manager that will be enforced when the memory is in short supply. As long as enough memory is available, the current working set size is allowed to grow larger than the value in MaxWorkingSet.
虽然 MSDN 不是真的 在这种情况下很有帮助,对流程进行了一项小型调查另一方面,Explorer 显示了
Private Memory
/MaxWorkingSet
和Shared Memory
/WorkingSet
的值> 几乎完全一样 匹配。这让我相信(是的,我确实缺乏确凿的证据)
MaxWorkingSet
确实显示了私有内存,而WorkingSet64
确实显示了完整的内存,包括共享的一个。我知道 MSDN 说什么...而且我不在乎,我在 Process Explorer 中看到了不同的东西。
While the MSDN is not really helpful in this case, a small investigation with the Process Explorer on the other hand revealed that the values for
Private Memory
/MaxWorkingSet
andShared Memory
/WorkingSet
do nearly exactly match.Which makes me believe (yes, I do lack hard evidence) that the
MaxWorkingSet
does display the private memory while theWorkingSet64
does display the complete memory, including shared one.I know what the MSDN says...and I don't care, I see something different in the Process Explorer.