Asp.net Mvc网站内存不足 [英] Asp.net Mvc site running out of memory

查看:256
本文介绍了Asp.net Mvc网站内存不足的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个奇怪的场景,其中网站似乎不时随机地耗尽内存:它工作了几周,然后突然所有内容都抛出了内存不足异常,并且一直持续到重启服务器为止.它可能在几周或几天后发生.我们无法确定常规模式.

I have a weird scenario in which the website seems to randomly run out of memory from time to time: it works for weeks then suddenly everything throws an out of memory exception, and it stays so until the server is rebooted. It may happen after weeks or after days. We weren't able to identify a regular pattern.

以下是此网站使用的技术资料的列表:

Here a list of tech stuff used for this site:

  • Net框架3.5
  • 带有C#的Mvc 2.0
  • 专用服务器上的IIS 6.0(无策略限制等)
  • 3层体系结构(ui-bll-dal)
  • Automapper 1.1.0.118
  • Elmah 1.1
  • FluentValidation 2.0
  • MvcContrib 2.0.95.0
  • MvcSiteMapProvider 3.0.0.1
  • 城堡2.5.2
  • NHibernate 3.0.0.4
  • FluentNHibernate 1.1.0.0
  • PdfSharp 1.31.1789.0
  • MarkdownSharp
  • Net framework 3.5
  • Mvc 2.0 with C#
  • IIS 6.0 on a dedicated server (no policy restrictions, etc)
  • 3 layer architecture (ui - bll - dal)
  • Automapper 1.1.0.118
  • Elmah 1.1
  • FluentValidation 2.0
  • MvcContrib 2.0.95.0
  • MvcSiteMapProvider 3.0.0.1
  • Castle 2.5.2
  • NHibernate 3.0.0.4
  • FluentNHibernate 1.1.0.0
  • PdfSharp 1.31.1789.0
  • MarkdownSharp

除此以外,该网站还包含(通过iframe)一些旧的旧版ASP表单.这些形式与旧版本的网站(完全在asp中)相同,但存在一些问题,但是旧版本从未耗尽内存.

Other than this, the site includes (via iframes) some old legacy asp forms. Those forms are the same that were on the old version of the site (which was entirely in asp), they have some problems but the old site never ran out of memory.

我已经检查过常见的东西,例如所有IDisposable实现类都在using语句内,没有无限循环,等等.

I've already checked common stuff, like all IDisposable implementing classes are inside using statements, no infinite loops, etc.

该网站并没有什么奇怪的事情,它从数据库中提取了一些新闻(例如新闻),在提交某些表单后即时生成了一些pdf文件,允许用户订阅新闻通讯.常见的东西.

The site doesn't do anything strange, it pulls some data from the DB like news, generates some pdf on the fly after certain form submissions, allows users to subscribe to a newsletter. The usual stuff.

我真的很笨,我已经开发了许多站点,几乎在所有地方都使用了提到的库,但这是我第一次遇到这种问题.

I'm really clueless, I've developed many sites, used the mentioned libraries almost everywhere, but this is the first time I experience this kind of problem.

我知道此信息不足以发现"问题,但如果有人能想到我可能忽略的某些内容或其他内容,将非常受欢迎:)

I know this information isn't enough to "find" the problem, but if anyone can think of something I might have overlooked, or anything, it will be very welcome :)

可能很重要的细节.我们有另一个网站在同一台服务器上运行(使用旧的asp制作),它运行良好,而另一个卡住了.因此,似乎服务器的整体内存并未耗尽,否则它也将无法正常工作.

A detail that might be important. We have another website running on the same server (made with old asp) and it runs just fine, while the other is stuck. So it seems like the overall server memory isn't depleted, otherwise it wouldn't work too.

推荐答案

安装 DebugDiag .触发它以转储该进程,因为它违反了内存阈值(例如,在300Mb,然后在此之后每100Mb).

Install DebugDiag. Trigger it to take dumps of the process as it breaches memory thresholds (say at 300Mb and then at every 100Mb after that).

比较转储文件应该为您提供一条有关突然占用所有内存的线索

Comparing the dump files should give you a clue as to what is suddenly occupying all that memory

这篇关于Asp.net Mvc网站内存不足的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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