Report with 55 pages (55 sub reports) - Loading 56 assemblies to memory at Render
Posted: Thu Mar 11, 2021 7:37 pm
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
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