Jump to content
We've recently updated our Privacy Statement, available here ×
  • Fixing high Memory usage / File sizes exporting from Ad-Hoc vs Studio based reports


    prusyn
    • Features: Ad Hoc Version: v7.2 Product: JasperReports® Server

    Use case:

    [toc on_off::hide=1]

    Customer has noticed that there appears to be a large difference in PDF output sizes between reports produced in Ad-Hoc vs similar reports produced within Studio and run on the server. This size difference appears to affect both the size of the file and the amount of time / memory used on the server whilst the export is being generated.  The amount of time to produce the files and the resultant file sizes vary hugely, sizes are below: 

    Studio Report : 28,764 KB 

    Ad-Hoc Report : 196,728 KB 

     

    The page counts between the two report differ slightly but that is because the row count per page is slightly different - 28 rows on the studio report vs 29 on the ad-hoc report, so the studio based report actually has more pages than the ad-hoc - The page size is also slightly different but I wouldn't think it was enough of a difference to be a problem (14in * 10in for Studio and 11in * 11in for ad-hoc).  Also, customer has also noticed that the two exports appear to create different PDF versions - 1.5 for the Studio report and 1.4 for the ad-hoc report. 


    Issue:

    An example customer was working on  - 200,000 rows with 33 columns (again, tested reports written in Studio one Ad-Hoc):

    • Studio report - JRS memory reached 1.9GB while report was executing and returned file was 35.4MB
    • Ad-Hoc report - JRS memory reached 4.97GB and then hung tomcat

    JRS did not produce an out of memory error but tomcat completely stopped responding.  Clearly such a large increase, both in terms of memory usage and file size has (potentially at least) quite a large impact on our hosted systems which are often running tens of customers per instance and potentially thousands of users.


    Resolution:

    The Adhoc PDF is much bigger because it includes 508 tags by default. If you edit the Adhoc report's JRXML and set the net.sf.jasperreports.export.pdf.tagged property to false, it will produce a 4MB PDF file:

     <property name="net.sf.jasperreports.export.pdf.tagged" value="false"/>

    Unfortunately, this property is hard coded. As far as I can see in the code, the property is always set to true for Adhoc reports. It overrides both template properties and global properties. Therefore I don't think there's a way to globally set it to false. There is an enhancement request JS-34525 for ability to set this property globally.

    So, at this moment this property has to be defined per Adhoc Report JRXML file.


    User Feedback

    Recommended Comments

    There are no comments to display.



    Create an account or sign in to comment

    You need to be a member in order to leave a comment

    Create an account

    Sign up for a new account in our community. It's easy!

    Register a new account

    Sign in

    Already have an account? Sign in here.

    Sign In Now

×
×
  • Create New...