.NET出现内存不足的故障排除 [英] .NET out of memory troubleshooting

查看:539
本文介绍了.NET出现内存不足的故障排除的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

阅读在.NET技术有关内存的几个启发性的文章之后,<一个href="http://blogs.msdn.com/b/ericlippert/archive/2009/06/08/out-of-memory-does-not-refer-to-physical-memory.aspx"相对=nofollow>内存不足并不是指物理内存,<一个href="http://stackoverflow.com/questions/597499/why-am-i-getting-an-out-of-memory-exception-in-my-c-application">597499.

After reading a few enlightening articles about memory in the .NET technology, Out of Memory does not refer to physical memory, 597499.

我想我明白了为什么一个C#应用程序会抛出内存溢出异常 - 直到我开始有两个ser​​vers--两者都具有RAM的2.5演出尝试,Windows Server 2003和运行同样的程序

I thought I understood why a C# app would throw an out of memory exception -- until I started experimenting with two servers-- both are having 2.5 gigs of ram, windows server 2003 and identical programs running.

两者之间的唯一差别显著为一种已离开和7%的硬盘驱动器存储的其它的50%以上。

The only significant difference between the two being one has 7% hard drive storage left and the other more than 50%.

7%的存储空间,左边的服务器始终抛出内存不足而另一个表现一直很好。

The server with 7% storage space left is consistently throwing an out of memory while the other is performing consistently well.

我的应用程序是进程的数百String对象的MB的一个C#Web应用程序。

My app is a C# web application that process' hundreds of MBs of String object.

为什么这种差异发生的看到,对于内存不足问题的最可能的原因是出连续的虚拟地址空间。

Why would this difference happen seeing that the most likely reason for the out of memory issue is out of contiguous virtual address space.

推荐答案

所有我能想到的是,你耗尽了虚拟内存。听起来像是你需要运行的应用程序中的内存分析器。

All I can think of is that you're exhausting the virtual memory. Sounds like you need to run a memory profiler on the app.

我已经使用了红门探查在过去的类似情况。你可能会惊讶你的字符串是多少内存实际使用。

I've used the Red Gate profiler in similar situations in the past. You may be surprised how much memory your strings are actually using.

这篇关于.NET出现内存不足的故障排除的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆