reportviewer 严重消耗内存

本文讨论了使用ReportViewer控件时遇到的内存泄漏问题。当报告数据量过大时,会导致内存消耗持续增加且无法释放。文章探讨了不同版本的ReportViewer中存在的此问题,并寻求解决方法。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

最近,發現當ReportViewer繫結的資料太大時,會發生 Memory leak。也就是吃記憶體,而且不會吐回來。

SQL reporting services ReportViewer control increases w3wp process memory

################# 

There are actually two problems here.  Running a report requires the report processing engine to generate and load an assembly in order to evaluate expressions in the report.  By default in local mode, this expression host assembly is loaded into the main appdomain.  Since assemblies can't be individually unloaded, it remains loaded permanently.

Local mode does have the option to run expressions in a sandboxed appdomain (ReportViewer.LocalReport.ExecuteReportInSandboxAppDomain()).  However, there is currently a bug that this appdomain does not get unloaded at the appropriate time.  We are currently working on a fix for this and hope to get this into VS 2008 SP1.  If you need a fix sooner, customer support may be able to provide additional options: http://support.microsoft.com/contactussupport

################# 

I'm using ReportViewer control in asp.net project and detect memory leak. I have installed visual studio 2008 sp1 and ReportViewer sp1, however the new ReportViewer (Version 9.0.0) doesn't solve the problem.
Could anybody provide some suggestion for web ReportViewer?
Thank you very much.

 

################# 

 

I observed the same problem using, in a batch process, iteratively the method ReportViewer.Render.

This causes a very problematic leak, my intention was to use ReportViewer to produce a lot of PDF documents (invoices) (> 5000 or more) and this leak forces me to stop-restart this batch process.

In other answers you say that the fix for this problem will come in a Microsoft ReportViewer for VS 2008 SP.

Is it possible to have a fix for this for .NET 2.0 (that is, with Microsoft ReportViewer for VS 2005)?

In my production systems for now I have .NET 2.0 Runtime installed and for now I have no time and plan to pass to .NET 3.5 to run the fix.

For now I haven't a plan to use Microsoft ReportViewer for VS 2008 (from Microsoft site, the Redistribuitable package  requires to install the .NET 3.5 runtime) and .NET 3.5 runtime.

Then, is it possible to have a fix for this problem that runs on .NET 2.0 Runtime?

 

If Session.Count > 0 Then
For i As Integer = 0 To Session.Count - 1
If Session(i).GetType().ToString() =
"Microsoft.Reporting.WebForms.ReportHierarchy" Then
Session.RemoveAt(i)
End If
Next
End If

 

 

http://social.msdn.microsoft.com/forums/en-US/vsreportcontrols/thread/143bc47c-d93f-4783-a37d-471bcb04203f/

http://social.msdn.microsoft.com/forums/en-US/vsreportcontrols/thread/d21f8b56-3123-4aff-bf84-9cce727bc2ce

 

http://social.msdn.microsoft.com/Forums/en-US/vsreportcontrols/thread/0da81cef-cb62-463f-9f4b-bd92f60a545e

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=449474&SiteID=1
http://www.scitech.se/blog/index.php/2007/10/05/memory-leak-in-toolstriptextboxcontrol/#comment-1295
https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=305199

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值