Jump to content
Changes to the Jaspersoft community edition download ×

Virtualizer Performance Settings


Recommended Posts



I've just started using a JRFileVirtualizer for report generation to overcome some memory issues.


I'm trying to figure out how to optimize this and from what I can tell the only configurable option is the maxsize parameter for the constructor.


I don't have the benefit of knowing which reports/parameter combinations will result in a memory issue, so i must always use the virtualizer with the same configuration.


I've tested 2340 page pdf and the results are a little surprising. with the maxsize at 5000 the report took 2:23, with max size at 2 the report took 2:45 compared to 2:14 with no virtualizer.


so it seems that using a virtualizer will slow the process (expected) and that the lower the maxsize the slower the process will become.


I'm assuming the lower the maxsize, the less physical memory is required? is that the trade off?


Where is the documentation for this?


What other optimization options are available?


Is there any way to tell jasper not to use the virtualizer unless the report is going to need one (ie: if large)?

Link to comment
Share on other sites

  • 2 weeks later...
  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

The max size arguments represents, according to the Javadocs, the maximum size (in JRVirtualizable objects) of the paged in cache. I.e. the number of report pages which will be kept in memory; when this threshold is reached, the contents of report pages will be written to the file system and only a page stud will be kept in memory. Your assumption is hence true, the max size parameter is directly linked to the amount of physical memory used by the report.


You can consult the Javadocs for a reference of existing virtualizer implementations and their configuration arguments.


Regarding your last question, the JR engine cannot know a priori whether a report is going to be large (it cannot know how many rows the dataset will returne and how much space will be used by each report element). Also, the current code needs to know from the beginning whether virtualization is used when generating a report, so that it prepares the report pages for it. Bearing this in mind, restricting the use of virtualization to large reports only is not possible.


However, if you, for example, define "large" reports as report having more than 500 pages, and set the max size of the virtualizer to 500, the effect is somewhat similar to what you were trying to achieve. If a report would have less than 500 pages, all its data would be kept in memory and no i/o would happen (but the fill would still take a little longer since some operations are performed to insure that the report pages are virtualizable). If a report would have more than 500 pages, only 500 would be kept in memory and the rest would be virtualized to the file system.




Link to comment
Share on other sites

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...