WebViewer Memory Leak / Consumption issues

Posted by: david.thompson on 14 May 2018, 9:14 am EST

    • Post Options:
    • Link

    Posted 14 May 2018, 9:14 am EST

    Environment: Windows Server 2008 R2, IIS V 5.5.7600.16385

    Data Source: <Seems to be arbitrary … but currently using MySQL>

    ActiveReports Version: 12 SP1 Developer

    Report Type: PageReport using FixedPage > Page > Containers > Table > Table Row > Table Cell

    The report is built dynamically in VB (.net 4.5) based on user input and user selections. So I don’t have an rdlx file but I could save one from the code if necessary.

    I’m trying to run reports using the WevViewer (HTML) and it would seem that the memory being consumed by the processes in IIS only growing and only is released when the app pool is stopped or recycled. The issue is more easily noticed when running large reports in succession. The reports we are developing are intended to be used in an enterprise application with hundreds-thousands of users at a time. I’m struggling to run 2-3 reports (50k rows each) at the same time before I run into memory issues.

    I’ve been combing over the forums and support topics and a lot of the other posts I’ve seen mention using cacheToDisk (which isn’t available for PageReports) … or releasing the report and/or document correctly (all of which seem to result the webviewer having errors or not displaying a report)

    If there is a proper way to release the PageReport being passed to the webviewer, could someone could provide an example of that?

    Aside from that I haven’t come across any other posts that have helped reduce the memory consumption.

  • Posted 14 May 2018, 9:22 am EST

    Here’s a code sample, to give you an idea of what I’m doing (in a very general way)

      
    
    'relevant part of the aspx file
    
                <ActiveReportsWeb:WebViewer ID="WebViewer" runat="server" Height="775px" ViewerType="HtmlViewer" CssClass="commWebViewer portrait" >
                </ActiveReportsWeb:WebViewer>
    
    'relevant part of the .aspx.vb file
    
    Public Function ViewMyReport(ByRef WebViewer As GrapeCity.ActiveReports.Web.WebViewer) As Boolean
    
        
    Dim rdlReport As New PageReport()
            Try
    
                '
                setReportMarkup(rdlReport, "pt", "portrait")
                rdlReport.Report.DataSources.Add(myDataSource())
                rdlReport.Report.DataSets.Add(myDataSet())
                rdlReport.Document.Printer.PrinterName = String.Empty
                rdlReport.Run()
                WebViewer.RenderMode = GrapeCity.ActiveReports.Web.RenderMode.Paginated
                WebViewer.Report = rdlReport
    
    
    
            Catch ex As Exception
                Dim x As String = ""
    
    
            End Try
    
        Return True
    
    End Function
    
  • Posted 14 May 2018, 7:50 pm EST

    Hello David,

    WebViewer control has SlidingExpirationInterval property related to the cache lifetime, by default it is set to 20m and you could set the shorter interval for the cache clear.

    Hope it helps.

    Thanks,

    Mohit

  • Posted 14 May 2018, 8:09 pm EST

    Try

    Using rdlReport As New PageReport()



    End Using

    It helps me with SectionReport and ActiveReports.Viewer.Win.Viewer

  • Posted 15 May 2018, 1:41 am EST

    Mohit,

    Thanks for the quick reply! I tried the sliding expiration interval with a shorter cache time (even as little as 30 seconds) that didn’t seem to improve anything.

    Additionally, some of my longer running reports can take several minutes to load completely and I wasn’t sure if that would affect their performance. …

  • Posted 15 May 2018, 1:45 am EST

    Ilia,

    Thanks for the suggestion!

    I tried implementing the ‘using’ condition. With other .NET memory issues I’ve had success implementing ‘using’ to ensure the objects get disposed, unfortunately in this case it didn’t solve the memory issue and to add insult to injury it also seems to create an issue where the license is no longer recognized we get the evaluation message in the webviewer

    “This document was created using an EVALUATION version of ActiveReports 12. Only a licensed user may legally create reports for use in production. Please report infractions or address questions to ActiveReports.Sales@grapecity.com. Copyright © 2018 GrapeCity, inc. All rights reserved.”

  • Posted 15 May 2018, 2:03 pm EST

    Try

    Using WebViewer …

    Or Using WebViwer Parent …

  • Posted 15 May 2018, 10:19 pm EST

    Hello,

    Thanks for the information.

    I am able to replicate the problem at our end. I have escalated this to the development team(Tracking ID 258339) and will revert you back once have any information from them.

    Thanks

    Mohit

  • Posted 16 May 2018, 12:36 am EST

    Hello David,

    You can also use our ActiveReport Server product. ActiveReports Server offers built-in load balancing, plug-and-play scalability, multi-tenant deployment, server-based print management, and Single Sign-On support. For end users, we have a responsive HTML5 Report Portal where they can schedule reports, export, and more from any touch-enabled device. For administrators, we have a responsive HTML5 Admin Dashboard where they can monitor, manage, and configure the server.

    For more information about Scalability, please refer the following link:

    http://help.grapecity.com/activereports/webhelp/AR12Server/webframe.html#AgentsAndScalability.html

    You can also download the trial version using the following link:

    https://grapecitycontentcdn.azureedge.net/downloads/activereports/ActiveReports12Server-v12.1.8986.0.exe

    Thanks,

    Mohit

  • Posted 16 May 2018, 3:54 am EST

    Hi Mohit, thanks for the updates and suggestion. I wanted to pass along the following information

    -I’ve rebuilt the reports using a SectionReport and am still finding the memory issues to be present. I also noticed that even paging through a report in a webviewer will gradually increase memory consumption (on the computer running the asmx web service) I suspect that to be at least one of the areas where there may be a leak

    Hope that helps!

  • Posted 16 May 2018, 4:15 pm EST

    Friend Class ReportMain

    Public rpt As rptReportAdv 'Inherits GrapeCity.ActiveReports.SectionReport



    Public Sub New()

    rpt = New rptReportAdv



    End Sub

          Public Sub Preview()
              Using frmp As New formPreview
                    With frmp
                        .arv.Document = rpt.Document
                        'rpt.Run(True)
                    .arv.Zoom = 1 'arv - GrapeCity.ActiveReports.Viewer.Win.Viewer
                        .arv.LoadDocument(rpt)
                        .ShowDialog()
                        rpt.Stop()
                    End With
                End Using
          End Sub
    

    End Class

    This code helps me to avoid memory growth

    in the COM-visible library.

  • Posted 16 May 2018, 8:19 pm EST

    Hello David,

    Thanks for the more details.

    I am discussing with our developer team and will inform you once I get any information from them.

    Thanks,

    Mohit

  • Posted 17 May 2018, 8:25 pm EST

    Hello,

    Could you please with the latest build of AR? Please refer the following link for the installer:

    http://cdn.grapecity.com/ActiveReports/ar12/hotfixes/ActiveReports-v12.1.13124.0.msi

    I have checked with the above build and found that memory release automatically after reloading page many times. I have checked with 1 lakh record and no memory related error is observed. Also please set the following line in “Web.Config” file

      <ActiveReports12>
        <WebService reportLifetime="00:03:00" reportsFolder="~/" assemblyFolder="~/"/>
      </ActiveReports12> 
    

    If the issue still reproducible, could you please share the sample where we can reproduce the out of memory error or application pool restart after several iterations of the report rendering.

    Sorry for the inconvenience caused.

    Thanks,

    Mohit

  • Posted 18 May 2018, 3:31 am EST

    Hi Mohit,

    I installed the hotfix and am still running into the same problem. I’ve confirmed the problem exists for the following environments / configurations

    Windows 2008 R2 / IIS 7.5

    Windows 10 / IIS 10

    I’ve attached an updated sample including the applied hotfix.

  • Posted 18 May 2018, 3:33 am EST

    Attachment didn’t work the first time

    ar-memory-leak-site.zip

  • Posted 20 May 2018, 9:37 pm EST

    Hello,

    Sorry to mention that I am unable to reproduce the issue with your sample. Please refer the attached video.

    Could you please confirm, If I am missing anything.

    Thanks,

    Mohit

    vid_Memory.zip

  • Posted 21 May 2018, 1:26 am EST

    There are two main things you may want to look at.

    1. If you delete or comment out the following line in Default.aspx.vb and re-run the same procedure you should see drastically smaller amount of memory consumed (in my case it was around 136 MB).
    st.ViewMyReport(WebViewer)
    
    
    1. After re-adding or un-commenting the code above, reload the page and run the reports a few times. After you’ve run the reports a few times,stop and do not refresh the page. Wait 5-10 minutes (or more) and come back to see if your iis worker process still is consuming ~1.5GB of memory. In my case even if I wasn’t running reports for quite some time the memory consumption still remains quite high.

    Compared to the actual reports we’d be running the sample report consumes far less memory, the amount of memory consumed effectively crippled the rest of our processes on the server.

  • Posted 21 May 2018, 9:20 pm EST

    Hello,

    Your question is already replied on other thread by our team member. Please use that thread for further inquiry. Here’ s the answer for other customer references,

    Our product is based on .NET Framework, so we just use Dispose() call for unused objects. it does not guaranty the immediately releasing of machine memory, since cleanup caused by GarbageCollector is initiated on low level.

    Thanks,

    Mohit

  • Posted 22 May 2018, 6:09 am EST

    Hi Mohit,

    Thank you for the reply.

    I did some testing and from what I can tell the issue does indeed appear to be a matter of garbage collection. For the time being I think this should conclude this particular inquiry. Thank you for your persistence !

  • Posted 22 May 2018, 5:36 pm EST

    Hello David,

    Thanks for the acknowledgement.

    Please feel free to revert back if you have any question related to this further.

    Thanks,

    Mohit

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels