我的记忆去哪儿了?
我们一直在使用 Vmmap、Processexplorer 和 MS Detours 来分析程序中的内存使用情况。 我们的目标是验证程序的内存使用情况。 例如,我们知道有 X MB 的数据从磁盘加载到内存中,我们希望确保我们不会以某种方式使用 2X MB 的内存来执行此操作。
然而,我们注意到以下差异: - 对于执行期间的特定点,Vmmap 将报告约 1310 MB 的私有工作集,其中 Processexplorer 将报告约 1304 MB(仅减少 6MB,但哪一个“更”准确......) - 使用 MS Detours 进行内存跟踪将报告从 HeapAlloc 调用分配的约 948 MB,但 Vmmap 会说该程序正在使用约 1143 MB 的私有堆
我的问题是, 除了我们的跟踪代码中的错误以及驱动程序映射的内存之外,任何人都可以解释 Vmmap 和 Processexplorer 如何比我们的 MS Detours 挂钩捕获更多的内存数据吗?
我们参与的其他值得注意的电话有: - 虚拟分配 - Zw分配虚拟内存 - RtlAllocateHeap - MapViewOfSection
非常感谢!
We have been using Vmmap, and Processexplorer and MS Detours to analyze the memory usage in our program.
Our goal was to validate our program's memory usage.
For example, we know that we have X MB of data which we load from disk into memory, we want to make sure that we are not somehow using 2X MB of memory doing this.
However, we noticed the following discrepancies:
- for a particular point during execution, Vmmap will report ~1310 MBs of private working set where Processexplorer will report ~1304 MBs (only 6MB off, but which one is "more" accurate...)
- memory tracking with MS Detours will report ~948 MBs allocated from HeapAlloc calls, but Vmmap will say that the program is using ~1143 MBs of private heap
My question is,
barring errors in our tracking code, and memory being mapped by drivers, can anyone explain how Vmmap and Processexplorer can capture more memory data than our MS Detours hooks?
Other notable calls which we have hooked into are:
- VirtualAlloc
- ZwAllocateVirtualMemory
- RtlAllocateHeap
- MapViewOfSection
Many thanks in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
它会建议在特定时间进行内存转储并在 Windbg 中打开它并执行 !address -summary。该命令应该告诉您每个内存区域的状态。
如果它是 .NET 应用程序,那么您可能需要深入研究 GC 堆。您可以参考文章http://vpnchoudhary.blogspot。 com/2011/03/out-of-memory-exception-simple.html 了解更多详细信息。
it would suggest take memory dump at that particular time and open it in windbg and do !address -summary. This command should tell you state of each memory region.
If its a .NET application then you may want to go deep and look into GC heap. You may refer the article http://vpnchoudhary.blogspot.com/2011/03/out-of-memory-exception-simple.html for more details.