c# - 了解 .NET 应用程序内存大小

标签 c# .net windows memory clr

我正在处理的应用程序在启动后立即占用 338MB 私有(private)字节和 780MB 虚拟字节。 我试图了解是什么占用了所有这些内存。希望在了解我能够减少它的大小之后。 这是一个 32 位 C# 应用程序,上面的数字是在 Windows7 64 位中运行时获取的。

用 windbg 打开转储显示堆大小为 47MB。 应用程序加载的外部库文件总大小为 60MB。

一个空的 C# 应用程序只占用 10MB,那么什么会导致我的应用程序达到 338MB 的私有(private)字节? 以及为什么windows7分配了780MB的虚拟内存?

任何指示都会有所帮助。

最佳答案

您可以利用 VMMap ,进程虚拟和物理内存分析实用程序 来自 Windows Sysinternals在 technet 网站上。

VMMapshows 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/

相关文章:

c# - 模拟 "inverse of ??"等运算符

c# - 将单个结果与多个其他结果连接起来的数据 block

c# - 如何使用 openFileDialog 打开 excel 文件

.net - 最佳 JIT 优化

c# - Thread.Sleep(Timespan.Zero) 可以在这种情况下明智地使用吗?

c# - 编辑 Xml 节点

c# - 样式化文本框光标/插入符号

python - SocketServer.TCPSocket 适用于 stock python,但不适用于使用更新的 OpenSSL 针对 MSVCRT100 编译的 python

c++ - QFuture 信号在错误的时间发出

Java 无法识别的选项 : -xvf