Report with 55 pages (55 sub reports) - Loading 56 assemblies to memory at Render

Stimulsoft Reports.NET discussion
Post Reply
lpinho
Posts: 7
Joined: Fri Aug 30, 2019 10:13 am

Report with 55 pages (55 sub reports) - Loading 56 assemblies to memory at Render

Post by lpinho »

Hi all,

I've got an application using Stimulsoft to render reports and print them or export to pdf.
The way the code is done is:
- Someone builds a layout
- This layout represents one or more page of the final report (1 layout can be used as the layout for each page of the report with different parameters)
- When the layout is to be repeated for each page of the report we use the subreports and for each page we use different parameters

Some reports reach 300 or plus pages, after one day of intensive work, the host reaches 30 or 40 GB and crashes due to the lack of memory.
In the code I can see a load from file code to have a sort of cache to reduce the number of assemblies in memory:
- we have a dictionary where we keep information that can identify the layout and the corresponding filename
- If we try a new print that have a similar layout, it will load the dll, set the parameters and render the file.

Even using this methodology we can see the number of assemblies increasing when we call the render method (1 assembly for each page, + one for the "final" report with all merged reports).
So, for each print that we do, we have 300 or plus assemblies added to memory.

EDIT: One of the test done was to use the CreateReportInNewAppDomain() method of the StiReport class and the UnloadReportAppDomain() method for uploading the report, but when the SubReports code was reached, an error was returned informing that the type doesn't implement the ISerializable.

The Stimulsoft version is 2018.2.3.0.

Can you help me out? (The code used to set the parameters is very scattered so, its hard to give it to you on a sample app)

Thanks,
LP
Lech Kulikowski
Posts: 6239
Joined: Tue Mar 20, 2018 5:34 am

Re: Report with 55 pages (55 sub reports) - Loading 56 assemblies to memory at Render

Post by Lech Kulikowski »

Hello,

The best way, in that case, is using Interpretation mode. If you do not use any code in events of reports, reports will work the same.

Thank you.
lpinho
Posts: 7
Joined: Fri Aug 30, 2019 10:13 am

Re: Report with 55 pages (55 sub reports) - Loading 56 assemblies to memory at Render

Post by lpinho »

Hi Lech,
sorry for the late reply, I forgot to activate the notifications.

Well, we don't use any events, we do have some values like reaching the 3 or 4th level of a property (ex: MyClass.PropertyThatIsAClass.AnotherPropertyThatIsAClass.StringProperty).
Each property that is a class is loading on the get method if its not yet initialized.
Will this work in interpretation mode? (dynamic load of the properties)

Thanks for your reply,
LP
Lech Kulikowski
Posts: 6239
Joined: Tue Mar 20, 2018 5:34 am

Re: Report with 55 pages (55 sub reports) - Loading 56 assemblies to memory at Render

Post by Lech Kulikowski »

Hello,

Yes, it should work in the interpretation mode.

Thank you.
Post Reply