.NET MVC 内存分析问题

发布于 2024-11-29 05:41:56 字数 580 浏览 6 评论 0原文

我正在对 ASP.NET MVC Web 应用程序的内存使用情况进行一些研究。 在我的研究中,我使用的是带有 IIS 6.1 的 Windows Server 2008 R2 和 Virtualbox 4.1 中的 SQL Server 2008 R2。 我选择使用虚拟服务器,因为它不是在实时服务器上进行测试的选项。对于分析,我使用 ANTS Memory Profiler 7.0。 一开始我想知道为什么即使是最简单的网站也已经使用了~30 - 40mb。

作为示例,我使用“我的 MVC 应用程序”网站,这是 Visual Studio 中的教程网站,但相同的概念适用于我分析的所有网站。当我在空闲状态下的网站中运行 ants profiler 时,我得到以下摘要:

第一代:26kb
第 2 代:2100kb
大对象堆:240kb
分配给 .NET 的未使用内存:3265kb
非托管:20890kb

现在,我想知道非托管块中有哪些信息?有什么方法可以让我找出并减小该块的大小吗?

此外,还有 7000 个字符串对象,在空闲模式下内存中总共约 600k。所有这些字符串从哪里来?我希望你能给我一些关于这些问题的信息。

I am doing some research on the memory usage of ASP.NET MVC web applications.
For my research i am using Windows Server 2008 R2 with IIS 6.1 and SQL Server 2008 R2 in Virtualbox 4.1.
I chose to use a virtual server because it was not an option to test on the live server. For profiling i am using ANTS Memory Profiler 7.0.
In the beginning i was wondering why even the most simple websites already use up to ~30 - 40mb.

As an example i am using the 'My MVC Application' website, which is the tutorial website in Visual Studio, but the same concept applies to all websites i profiled. When i run ants profiler in the website in idle state, i get the following summary:


Generation 1: 26kb
Generation 2: 2100kb
Large object heap: 240kb
Unused memory allocated to .NET: 3265kb
Unmanaged: 20890kb

Now, i am wondering what information is in the unmanaged block? Is there any way for me to find out and maybe lower the size of this block?

Also, there are 7000 string objects, which make up ~600k in total in memory in idle mode. Where do all these strings come from? I hope you can give me some info on these questions.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

攒一口袋星星 2024-12-06 05:41:56

如果您使用的是 ANTS Memory Profiler 7,请使用 实例分类器,例如,对字符串实例进行分割并找出它们的来源。它在这样的情况下特别有用,即您有数千个实例,并且您想要弄清楚它们来自哪里。字符串经常需要这种分析。

If you're using ANTS Memory Profiler 7, use the Instance Categorizer on, for example, the string instances to carve them up and work out where they originate from. It's particularly useful in situations like this where you've got thousands of instances, and you want to work out where they are coming from. Strings need this sort of analysis very often.

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