- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
Environment.WorkingSet 错误地报告了在 Windows 2003 Server 上运行的网站的内存使用情况。(操作系统版本:Microsoft Windows NT 5.2.3790 Service Pack 2,.NET 版本:2.0.50727.3607)
它将内存报告为 Working Set(Physical Mem.): 1952 MB (2047468061)。
同一个网站在 Windows Vista 上本地运行,工作集(物理内存):49 MB (51924992)。
我对服务器的访问有限,支持也很有限:(。
所以我通过遍历 VirtualQuery 计算了总内存。
具有状态的页面总数:MEM_FREE 为 1300 MB。
(我猜服务器有 4 GB 的 RAM 并且未启用 PAE,最大用户模式虚拟地址为 0x7fff0000。)
所以,我知道工作集不仅仅是关于虚拟内存。但是,有这么高的工作集,而在另一台机器上却很低,这正常吗?
最佳答案
我认为问题与 this article 中描述的内容有关:
MAY 04, 2005
Fun with the WorkingSet and int32
I finally found an honest to goodness bug in the .NET framework.... the WorkingSet returns the amount of memory being used by the process as an integer (32 bit signed integer). OK, so the maximum value of an integer is 2,147,483,647 -- which is remarkably close to the total amount of memory that a process can have in its working set.
... There is actually a switch in Windows that will allow a process to use 3 gig of memory instead of 2 gig. This switch is often turned on when dealing with Analysis Services -- this thing can be a memory hog. So now what happens is that when I poll the WorkingSet I get a negative number, a really big negative number. Usually, in the realm of -2,147,482,342.
... The problem was the overflow bit.
Working set is returned to the .NET framework as a binary value. The first bit of an integer is the sign bit. 0 is positive, 1 is negative. So, when the value turned from (binary) 1111111111111111111111111111111 to (binary) 10000000000000000000000000000000 the value goes from 2147483647 to -2147483647.
OK, so I still have to fix this. Here is what I came up with (in C#):
long lWorkingSet = 0;
if (process.WorkingSet >= 0)
lWorkingSet = processWorkingSet;
else
lWorkingSet = ((long)int.MaxValue*2)+process.WorkingSet;Hopefully that fixes the problem for now.
The real question will come in down the road. Microsoft knows about this problem. I still have find out how they are going to fix this for Win64...where this trick will no longer work.
http://msdn2.microsoft.com/library/0aayt1d0(en-us,vs.80).aspx:
There's gonna be a Process.WorkingSet64 variable, and they're deprecating WorkingSet.On a tangent, though, I thought it was impossible for a managed process to come near the 3gb limit, because the runtime splits the memory into multiple heaps. Is this not true?
关于asp.net - Environment.WorkingSet 错误地报告内存使用情况,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3378874/
我在"file"应用程序中遇到工作集枚举器(“最近”选项卡)的问题。我为文件夹实现了一个工作枚举器,它运行 enumerateItems(当我移动到 UI 中的文件夹时用于观察者方法并且一切正常。我也
我尝试使用 pymongo 获取“workingSet”指标。在 MongoDB 中只是 db.runCommand( { serverStatus: 1, workingSet: 1 } )。我在
Environment.WorkingSet 错误地报告了在 Windows 2003 Server 上运行的网站的内存使用情况。(操作系统版本:Microsoft Windows NT 5.2.37
我正在 Eclipse 中重新创建一个资源管理器,它应该启用工作集作为顶层样式。有没有办法访问 eclipse jdt 创建的“其他工作集”?我尝试创建自己的 localWorkingSetManag
无聊的好奇... 我正在查看当前进程的一些属性: using(Process p = Process.GetCurrentProcess()) { // Inspect properties
在运行我的.net进程很长时间后,我发现GC感知的内存和进程工作集之间存在很大差异。 我正在监视的值是 GC.GetTotalMemory(false) 和 Process.WorkingSet。 如
如果我在 C++ 中使用以下调用,我希望进程的 WorkingSet 永远不会低于 100MB。 但是,即使我进行此调用,操作系统仍将工作集缩减为 16MB。 将 WorkingSet 设置为 100
我是一名优秀的程序员,十分优秀!