为什么 Process.WorkingSet >进程最大工作集?

发布于 2024-12-04 06:37:21 字数 433 浏览 0 评论 0原文

无聊的好奇心......

我正在查看当前进程的一些属性:

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

邮友 2024-12-11 06:37:21

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.

烈酒灼喉 2024-12-11 06:37:21

虽然 MSDN 不是真的 在这种情况下很有帮助,对流程进行了一项小型调查另一方面,Explorer 显示了 Private Memory/MaxWorkingSetShared 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 and Shared 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 the WorkingSet64 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文