This is a migrated thread and some comments may be shown as answers.

How to estimate memory usage when export pdf

3 Answers 361 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Voraluck
Top achievements
Rank 1
Voraluck asked on 01 Feb 2021, 06:14 AM

I create report base on Telerik Reporting Q3 2015 SP1 

my report contain 4 group headers

each data row return on report like  detailsection|group1|group2|group3|group4

report use data return from database only fields that use format number digit or date format in expressions and no calculated field in report

report also use PageCount and PageNumber and 1 logo picture on PageHeaderSection

because this report have to be approved in the same document and data return from database is about 60,000 ~ 100,000 records, number of page about 3500-4000 pages

when I export as pdf it show message system out of memory exception in server side that report deploy in web MVC there is 2gb memory available. 

my question is if export large data perform, how to calculate memory usage and plan to extend memory size on the server, or is there any way that improve my report when export file? 

thank you.

3 Answers, 1 is accepted

Sort by
0
Eric R | Senior Technical Support Engineer
Telerik team
answered on 03 Feb 2021, 09:06 PM

Hi Voraluck,

I am sorry to hear that your machine is running out of memory on export. Unfortunately, this can happen for several reasons. However, I do believe the number of pages and the size of the data are significant issues. Let me go over some troubleshooting issues below. 

Troubleshooting Information

Let me first start by providing memory usage infromation. This is becauase it can be difficult to estimate the memory usage because of the complexity with reports.

We do have Performance Considerations that can help identify specific issues with the current design. My frist recommendation is to try and find a way to reduce the large amount of data.

Configuring the Reporting REST Service

If the web application is hosted on Microsoft Azure Web Apps, we have a workaround that is described in the GDI+ Error or OutOfMemoryException article.

If the report must be delivered through a web browser using the Reporting REST Service, then the worker count can be increased as well size of the machine.

Alternative Processing

An alternative usage is to export and deliver the report outside of the web application. For example, Report Server has the capability to schedule and email reports which can be done in off-peak times. 

Benchmarks

Benchmarks could be run on a local development environment. There are tools like the Task Manager that can be used to identify how much memory is needed to process the report.

Wrapping Up

Please let me know if any of the above options are suitable for your scenario. Thank you and I look forward to your reply.

Regards,


Eric R | Senior Technical Support Engineer
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

0
Voraluck
Top achievements
Rank 1
answered on 04 Feb 2021, 04:46 AM

I try to run report on dev machine with ram 16gb and hdd space 3gb+

when render report on website the memory peak (from task manager) in IIS express go up to 2.9gb and in take time to render report but there is no error on this step

after report done processing and click export and report show Preparing document to download. Please wait...

the report show error 

Internal Server Error
Exception of type 'System.OutOfMemoryException' was thrown.

 

in stack trace 

{

"message":"","exceptionMessage":"Exception of type 'System.OutOfMemoryException' was thrown.","exceptionType":"Telerik.Reporting.Services.Engine.DocumentRenderException",

"stackTrace":" at Telerik.Reporting.Services.Engine.Document.GetDocumentInfo()\r\n at Telerik.Reporting.Services.Engine.ReportEngine.GetDocumentInfo(String clientID, String instanceID, String documentID)\r\n at Telerik.Reporting.Services.WebApi.ReportsControllerBase.GetDocumentInfo(String clientID, String instanceID, String documentID)\r\n at lambda_method(Closure , Object , Object[] )\r\n at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass10.<GetExecutor>b__9(Object instance, Object[] methodParameters)\r\n at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.Execute(Object instance, Object[] arguments)\r\n at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary`2 arguments, CancellationToken cancellationToken)\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__0.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__2.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Controllers.ExceptionFilterResult.<ExecuteAsync>d__0.MoveNext()"}

 

I'm going to try export  Exporting Report Programmatically 

0
Eric R | Senior Technical Support Engineer
Telerik team
answered on 04 Feb 2021, 03:41 PM

Hi Voraluck,

No problem. I think exporting the report programmatically is a good option in this case due to the size of the report and its data. 

For additional reference, see the Exporting a Report to as Single Document Format and the Run a C# .NET Console Application as a Windows Service articles.

The above articles should be enough to create a Windows Service that Exports and Emails the report on a schedule. Note that we cannot offer support for third-party API or integrations.

Please let me know if you need any additional information. Thank you.

Regards,


Eric R | Senior Technical Support Engineer
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
General Discussions
Asked by
Voraluck
Top achievements
Rank 1
Answers by
Eric R | Senior Technical Support Engineer
Telerik team
Voraluck
Top achievements
Rank 1
Share this question
or