Getting System.OutOfMemoryException when using ReportViewer contol in Local mode
来源:互联网 发布:ae软件制作视频教程 编辑:程序博客网 时间:2024/05/22 13:43
PROBLEM:
========
- Consider you've a ASP.NET application that contains Report Viewer control (2005 / 2008) in Local Mode.
- You have an RDLC report file, that loads large amount of data / has lots of expressions. (Both are not recommended in Local mode)
- Everytime you refresh the web page, the Report Viewer stores objects in the session.
- The behaviour of Report Viewer storing objects in the session is by design.
- Each time the report viewer page is refreshed the complete report info object is added to session.
- These objects obviously gets deeply rooted in session and so Garbage collector never collects them untill the complete app unloads itself.
- And that is apparently going to increase the memory pressure in multiple folds, ending up with System.OutOfMemoryException.
RESOLUTION: (Please note: This doesn't guarantee to resolve the exception. The Out of Memory exception can be caused due to different reasons and the below workaround is for one such scenario, which can help to avoid this error to a certain extent.)
===========
== In the page_load event, add this,
if(Session.Count > 0)
{
for (int i = 0; i < Session.Count; i++)
{
if (Session[i].GetType().ToString() == "Microsoft.Reporting.WebForms.ReportHierarchy")
{
Session.RemoveAt(i);
}
}
}
source: http://blogs.msdn.com/selvar/archive/2008/07/18/getting-system-outofmemoryexception-when-using-reportviewer-contol-in-local-mode.aspx
- Getting System.OutOfMemoryException when using ReportViewer contol in Local mode
- Using the ASP.NET 2.0 ReportViewer in Local Mode
- System.OutOfMemoryException
- System.OutOfMemoryException
- System.OutOfMemoryException
- System.OutOfMemoryException
- System.OutOfMemoryException
- System.OutOfMemoryException
- .Net System.OutOfMemoryException
- System.OutOfMemoryException处理
- Using local Logon Scripts in Windows XP
- Local File Manage in JavaScript Using FileSystemObject
- LOSS OF SYSTEM FILE IN ARCHIVELOG MODE
- System.OutOfMemoryException: 引发类型为“System.OutOfMemoryException”的异常
- 解决'System.OutOfMemoryException' 的问题
- .Net 内存溢出(System.OutOfMemoryException
- Let Textbox support Maxlength when in Multiline mode
- Deploying RDLC files in local mode for ASP.NET applications
- 使用批处理或C#代码 注册ArcEngine Runtime授权,自动检测AE Runtime安装位置
- 分隔
- 新版盖莫游戏引擎的图形测试
- Windows虚拟键盘、鼠标消息代码大全列表
- Visual Basic数学函数
- Getting System.OutOfMemoryException when using ReportViewer contol in Local mode
- Android Service
- 单线程内存池
- 多线程内存池
- 使用snooper taoism版,显示非本地字符的ansi字符
- 梦.是虾米?要挂了么?
- dlmalloc、nedmalloc
- mysql 同步出错 快速恢复
- 线程关联的内存池