MVC刚写的系统提示内存有问题,这个要怎么解决呢?

禁用F3 2014-11-13 12:57:32
访问总是提示
Exception of type 'System.OutOfMemoryException' was thrown.

重启IIS又好了,这是什么原因引起的呢?数据查询是用的EF查询的。
...全文
353 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
VisualTeam 2014-12-12
  • 打赏
  • 举报
回复
检查程序是否有多次NEW,而没有比放掉,或多次查询数据库的数据集资源没有比释放
Aries_0219 2014-11-19
  • 打赏
  • 举报
回复
内存溢出啊。。你看看哪里对象没释放,或者哪里存的数据太多了
禁用F3 2014-11-19
  • 打赏
  • 举报
回复
有一个这样的错误

日志名称:          Application
来源:            ASP.NET 4.0.30319.0
日期:            2014/11/18 18:10:14
事件 ID:         1325
任务类别:          无
级别:            错误
关键字:           经典
用户:            暂缺
计算机:           SERVER01
描述:
An unhandled exception occurred and the process was terminated.

Application ID: DefaultDomain

Process ID: 7344

Exception: System.OutOfMemoryException

Message: Exception of type 'System.OutOfMemoryException' was thrown.

StackTrace:    at System.Threading.ThreadPoolWorkQueue.EnsureCurrentThreadHasQueue()
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
   at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()
事件 Xml:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
  <System>
    <Provider Name="ASP.NET 4.0.30319.0" />
    <EventID Qualifiers="49152">1325</EventID>
    <Level>2</Level>
    <Task>0</Task>
    <Keywords>0x80000000000000</Keywords>
    <TimeCreated SystemTime="2014-11-18T10:10:14.000000000Z" />
    <EventRecordID>16930</EventRecordID>
    <Channel>Application</Channel>
    <Computer>SERVER01</Computer>
    <Security />
  </System>
  <EventData>
    <Data>An unhandled exception occurred and the process was terminated.

Application ID: DefaultDomain

Process ID: 7344

Exception: System.OutOfMemoryException

Message: Exception of type 'System.OutOfMemoryException' was thrown.

StackTrace:    at System.Threading.ThreadPoolWorkQueue.EnsureCurrentThreadHasQueue()
   at System.Threading.ThreadPoolWorkQueue.Dispatch()
   at System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()</Data>
  </EventData>
</Event>
禁用F3 2014-11-19
  • 打赏
  • 举报
回复
服务器事件日期有这个警告
引用 4 楼 lutaiyu 的回复:
去看下windows的事件日志,还有在可能报错内存溢出的代码 try catch一下 捕捉一下异常并打日志下来

日志名称:          Application
来源:            ASP.NET 4.0.30319.0
日期:            2014/11/19 11:50:11
事件 ID:         1309
任务类别:          (3)
级别:            警告
关键字:           经典
用户:            暂缺
计算机:           SERVER01
描述:
Event code: 3003 
Event message: A validation error has occurred. 
Event time: 2014/11/19 11:50:11 
Event time (UTC): 2014/11/19 3:50:11 
Event ID: 896553448fea4287ba828b5d55ced22b 
Event sequence: 70940 
Event occurrence: 7 
Event detail code: 0 
 
Application information: 
    Application domain: /LM/W3SVC/4/ROOT-1-130607807293282222 
    Trust level: Full 
    Application Virtual Path: / 
    Application Path: D:\WebSite\WWW\ 
    Machine name: SERVER01 
 
Process information: 
    Process ID: 5032 
    Process name: w3wp.exe 
    Account name: IIS APPPOOL\WWW 
 
Exception information: 
    Exception type: HttpRequestValidationException 
    Exception message: A potentially dangerous Request.Form value was detected from the client (on/getemail="...url][/b]
<strong><a href="htt...").
   at System.Web.HttpRequest.ValidateString(String value, String collectionKey, RequestValidationSource requestCollection)
   at System.Web.HttpRequest.<>c__DisplayClass5.<ValidateHttpValueCollection>b__3(String key, String value)
   at System.Web.HttpValueCollection.EnsureKeyValidated(String key)
   at System.Web.HttpValueCollection.Get(String name)
   at System.Web.Caching.OutputCacheModule.CreateOutputCachedItemKey(String path, HttpVerb verb, HttpContext context, CachedVary cachedVary)
   at System.Web.Caching.OutputCacheModule.CreateOutputCachedItemKey(HttpContext context, CachedVary cachedVary)
   at System.Web.Caching.OutputCacheModule.OnLeave(Object source, EventArgs eventArgs)
   at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

 
 
Request information: 
    Request URL: http://www.test.com/Infor/GetEmail 
    Request path: /Infor/GetEmail 
    User host address: 117.207.202.122 
    User:  
    Is authenticated: False 
    Authentication Type:  
    Thread account name: IIS APPPOOL\WWW 
 
Thread information: 
    Thread ID: 27 
    Thread account name: IIS APPPOOL\WWW 
    Is impersonating: False 
    Stack trace:    at System.Web.HttpRequest.ValidateString(String value, String collectionKey, RequestValidationSource requestCollection)
   at System.Web.HttpRequest.<>c__DisplayClass5.<ValidateHttpValueCollection>b__3(String key, String value)
   at System.Web.HttpValueCollection.EnsureKeyValidated(String key)
   at System.Web.HttpValueCollection.Get(String name)
   at System.Web.Caching.OutputCacheModule.CreateOutputCachedItemKey(String path, HttpVerb verb, HttpContext context, CachedVary cachedVary)
   at System.Web.Caching.OutputCacheModule.CreateOutputCachedItemKey(HttpContext context, CachedVary cachedVary)
   at System.Web.Caching.OutputCacheModule.OnLeave(Object source, EventArgs eventArgs)
   at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
 
 
Custom event details: 
事件 Xml:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
  <System>
    <Provider Name="ASP.NET 4.0.30319.0" />
    <EventID Qualifiers="32768">1309</EventID>
    <Level>3</Level>
    <Task>3</Task>
    <Keywords>0x80000000000000</Keywords>
    <TimeCreated SystemTime="2014-11-19T03:50:11.000000000Z" />
    <EventRecordID>16969</EventRecordID>
    <Channel>Application</Channel>
    <Computer>SERVER01</Computer>
    <Security />
  </System>
  <EventData>
    <Data>3003</Data>
    <Data>A validation error has occurred.</Data>
    <Data>2014/11/19 11:50:11</Data>
    <Data>2014/11/19 3:50:11</Data>
    <Data>896553448fea4287ba828b5d55ced22b</Data>
    <Data>70940</Data>
    <Data>7</Data>
    <Data>0</Data>
    <Data>/LM/W3SVC/4/ROOT-1-130607807293282222</Data>
    <Data>Full</Data>
    <Data>/</Data>
    <Data>D:\WebSite\WWW\</Data>
    <Data>SERVER01</Data>
    <Data>
    </Data>
    <Data>5032</Data>
    <Data>w3wp.exe</Data>
    <Data>IIS APPPOOL\WWW</Data>
    <Data>HttpRequestValidationException</Data>
    <Data>A potentially dangerous Request.Form value was detected from the client (on/getemail="...url][/b]
<strong><a href="htt...").
   at System.Web.HttpRequest.ValidateString(String value, String collectionKey, RequestValidationSource requestCollection)
   at System.Web.HttpRequest.<>c__DisplayClass5.<ValidateHttpValueCollection>b__3(String key, String value)
   at System.Web.HttpValueCollection.EnsureKeyValidated(String key)
   at System.Web.HttpValueCollection.Get(String name)
   at System.Web.Caching.OutputCacheModule.CreateOutputCachedItemKey(String path, HttpVerb verb, HttpContext context, CachedVary cachedVary)
   at System.Web.Caching.OutputCacheModule.CreateOutputCachedItemKey(HttpContext context, CachedVary cachedVary)
   at System.Web.Caching.OutputCacheModule.OnLeave(Object source, EventArgs eventArgs)
   at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

</Data>
    <Data>http://www.test.com/Infor/GetEmail</Data>
    <Data>/Infor/GetEmail</Data>
    <Data>117.207.202.122</Data>
    <Data>
    </Data>
    <Data>False</Data>
    <Data>
    </Data>
    <Data>IIS APPPOOL\WWW</Data>
    <Data>27</Data>
    <Data>IIS APPPOOL\WWW</Data>
    <Data>False</Data>
    <Data>   at System.Web.HttpRequest.ValidateString(String value, String collectionKey, RequestValidationSource requestCollection)
   at System.Web.HttpRequest.<>c__DisplayClass5.<ValidateHttpValueCollection>b__3(String key, String value)
   at System.Web.HttpValueCollection.EnsureKeyValidated(String key)
   at System.Web.HttpValueCollection.Get(String name)
   at System.Web.Caching.OutputCacheModule.CreateOutputCachedItemKey(String path, HttpVerb verb, HttpContext context, CachedVary cachedVary)
   at System.Web.Caching.OutputCacheModule.CreateOutputCachedItemKey(HttpContext context, CachedVary cachedVary)
   at System.Web.Caching.OutputCacheModule.OnLeave(Object source, EventArgs eventArgs)
   at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
</Data>
  </EventData>
</Event>
禁用F3 2014-11-14
  • 打赏
  • 举报
回复
就是没有看到详细信息,有提还会提示 An error occurred while executing the command definition. See the inner exception for details.
Aries_0219 2014-11-14
  • 打赏
  • 举报
回复
去看下windows的事件日志,还有在可能报错内存溢出的代码 try catch一下 捕捉一下异常并打日志下来
  • 打赏
  • 举报
回复
堆栈溢出。 这根本不是什么“你电脑的内存不够用”。 在开发环境重现bug,贴出调试画面,找出具体的有异常的语句来进行来调试。
duanzhaoqian 2014-11-13
  • 打赏
  • 举报
回复
内存不够用了,也可能是有死循环

111,119

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • AIGC Browser
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧