Not releasing the memory after completion of rendering - ReportProcessor.RenderReport

2 posts, 0 answers
  1. Kris
    Kris avatar
    2 posts
    Member since:
    Mar 2011

    Posted 11 Sep 2016 Link to this post


    We have below lines of code for exporting the report in XLS format. 

    After running performance test using windows performance monitor tool, we observed high memory utilization while executing RenderReport method.

    However the serious concern is RenderReport method is not releasing the memory after finishing its execution. Need your urgent help/support. 

    Additional design information - 

    The Telerik report uses report controller as a DataSource & its action method as a DataMember. Action method consumes WCF service which gets the data from the database. RenderReport method internally makes a call to this action method which executes fine (not much memory utilization) however after that when it receives the data (type as List) from action method and  starts actual rendering with the data & template, it suddenly starts utilizing high memory which it fails to release after completion.

    Minimum number of records tested  - 390 approx.

    More information - 
    Telerik.Reporting versions used: &
    Dev machine details:                     Intel I5/2.4Ghz processor, 8 GB RAM


    var reportProcessor     =new ReportProcessor();
    var deviceInfo              =new Hashtable();
    var typeReportSource =new TypeReportSource();

    typeReportSource.TypeName = Type.GetType(typeof(T).Namespace + "." + reportName).AssemblyQualifiedName;


    var result = reportProcessor.RenderReport(reportExportType, typeReportSource, deviceInfo);

    string fileName = result.DocumentName + "." + result.Extension;
    string path        = System.IO.Path.GetTempPath();
    string filePath   = System.IO.Path.Combine(path, fileName);

    using (MemoryStream ms = new MemoryStream())
        ms.Write(result.DocumentBytes, 0, result.DocumentBytes.Length);
        FileContentResult fileContentResult = new FileContentResult(ms.GetBuffer(), result.MimeType);
        fileContentResult.FileDownloadName = fileName;
        return fileContentResult;

  2. Katia
    Katia avatar
    760 posts

    Posted 12 Sep 2016 Link to this post

    Hello Kris,

    I will post here the reply from the support ticket you opened on the same question:

    "In general, report processing and rendering are memory intensive operations. During the report generation, besides the retrieved data there are newly generated resources by the report which are held in memory. Thus, the machine should have enough memory and CPU to handle the amount of data and the document processing.
    For more detailed information and suggestions for improving the report's performance please check Performance Considerations help article.

    Note, that controlling when the garbage collector fires is not done by us. You can force the garbage collection if required - check this MSDN article."

    In the end of this reply, there is a list of the additional information we would need in order to provide you further suggestions.

    Telerik by Progress
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top