WebViewer memory leak problem


06-08-2009, 2:16 AM
Hello!

I have a situation with ActiveReports 3.0. and WebViewer control. I have a asp.net website to display my reports on the web site i have a webviewer control... my reporting structure is made up of .rpx files witch i load dynamicly into a ActiveReport3 object with LoadLayout Method... each request has its own set ov settings witch .rpx files to load. I also use SubReports in my raporting structure witch means that i also have some scripts in my .rpx fiels.

The problem i am facing is that each request produces some amount of memory that is not dealocated. My first thought was that i'm missing some .Dispose() somwhere in the structure of my reporting mechanism. But that's not the case. in my code, i override the Dispose method of the Page object were the webviewer control i on. In the Dispose method i do all the Disposing that i can do. all instantiated objects that can be disposed i do dispose including the ActiveReport3 object and the Webviewer object.

My second thought was poperly disposing my subreports in the script of a .rpx file. and there is was no diference if i call the dispose method for all the subreports palceholder objects in the report_end event of the main report or if i dont call it.

After two sleepless days i was sure that i do properly dispose my objects.

So i went to profile my site. i did so with JetBrains dotTrace profiler. the results are very interesting. My test workset where 90 requests for the same report. Each memory snap shot that i took was between 20 MB and 25 MB  memory that was held or not deallocated. Abot 50% of that memory belongs to the WebViewer control methot (Void DataDynamics.ActiveReports.Web.WebViewer.RenderChildren(HtmlTextWriter))
and other 50% to ActiveReport3 objects methods (Void DataDynamics.ActiveReports.ActiveReport3.LoadLayout(String) and Void DataDynamics.ActiveReports.ActiveReport3.Run()).

I attached my website code and my rpxfiles that are participating in the request i was profiling. I also attached the view of the profiler where it's visible what is cousing my problems. I did not attach the whole snapshot due to it's size.

I do need to find a solution for my problem and i hope that you will help me i some way...



Re: WebViewer memory leak problem


06-08-2009, 4:49 AM
I can also confirm that when I was using the WebViewer control, my reports were running 5 seconds slower every time.  I did have a lot of sub-reports.  It started at 15 seconds and would run 5 seconds slower every subsequent time.

In the end I changed my structure to use XSLT to generate HTML into a RichTextBox, instead of using subreports, as well as working with an IFRAME and Adobe Reader instead, and now my perform is much steader.

Re: WebViewer memory leak problem


06-11-2009, 12:35 PM
Hello,

Thank you for your patience. I have tested the issue by creating a website with multiple Subreports and loading the layout of the reports at run time, but was not able to reproduce the behavior. I used the MemProfiler to test the issue.
Looking at the aspx.cs file I am not able to locate the reason to why you are getting this error message. To isolate the issue you need to separate the Report.Run from the other sections of your report.
In order to make sure this issue is related to ActiveReports I need a sample application to test with. Please send me a sample application so that I can further test this issue.

Regards,
Ankit Nigam