我正在处理的应用程序在启动后立即占用 338MB 私有(private)字节和 780MB 虚拟字节。 我试图了解是什么占用了所有这些内存。希望在了解我能够减少它的大小之后。 这是一个 32 位 C# 应用程序,上面的数字是在 Windows7 64 位中运行时获取的。
用 windbg 打开转储显示堆大小为 47MB。 应用程序加载的外部库文件总大小为 60MB。
一个空的 C# 应用程序只占用 10MB,那么什么会导致我的应用程序达到 338MB 的私有(private)字节? 以及为什么windows7分配了780MB的虚拟内存?
任何指示都会有所帮助。
最佳答案
您可以利用 VMMap ,进程虚拟和物理内存分析实用程序
来自 Windows Sysinternals
在 technet 网站上。
VMMap
shows a breakdown of a process's committed virtual memory types as well as the amount of physical memory (working set) assigned by the operating system to those types. Besides graphical representations of memory usage, VMMap also shows summary information and a detailed process memory map. Powerful filtering and refresh capabilities allow you to identify the sources of process memory usage and the memory cost of application features.Besides flexible views for analyzing live processes, VMMap supports the export of data in multiple forms, including a native format that preserves all the information so that you can load back in. It also includes command-line options that enable scripting scenarios.
VMMap is the ideal tool for developers wanting to understand and optimize their application's memory resource usage.
关于c# - 了解 .NET 应用程序内存大小,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6569089/