[Performance] Minimise Memory Usage For Report Generation

Un Check the “Keep Page Count” Property to minimise the memory usage for report generation

This property is enabled by default, allowing you to use page count substitutions (ie. ${##}) within your report. Page counting is expensive because the whole report needs to be kept in memory until the page count is known, only then can the first page be output (presumably showing the page count). If you don’t need to show an overall page count you will get much better memory use by turning this off. PDF output format is special, in that it allows page counts to be forward referenced, so page counts will still work in PDF even with this option disabled. Therefore for optimal PDF output (smallest memory use), you should disable this. In all other formats, you will get a value of 0 for page count if this flag is not enabled.

Therefore, in order to minimse the memory usage for report generation, you should un-check the “Keep Page Count”.

This works best for PDF, as it is also able to show the count substitutions for both cases.

Under the Report Properties -

fig3-report-properties

Test scenario to show the performance difference (on memory utilisation) checking & unchecking this property.

1/ Report Generation of 100,000 records & checking “Keep Page Count” Property -

From the above, you can see that the memory utilised for this report generation takes approximately up to 1000MB (1GB). This is because the whole report needs to be kept in memory until the page count is known.

2/ Next, Report Generation of 100,000 records & un-checking “Keep Page Count” -

From the above, you can see that the memory utilised for this report generation takes approximately only up to 400MB.

Therefore, the concluded result shows the performance improvement by un-checking “Keep Page Count” Property.