The JRFileVirtualizer is the original one, but it was mainly a proof of concept (written while I was evaluating JR; the JR developers have fixed it up, too). It creates a separate file for each virtualized page, which can lead to having lots of temporary files.
I recommend using the JRSwapFileVirtualizer because it creates just one file for the report.
JRSwapFileVirtualizer virtualizer = null;
try {
JRSwapFile swapFile = new JRSwapFile("directory", 1024, 100);
virtualizer = new JRSwapFileVirtualizer(50, swapFile, true);
params.put(JRParameter.REPORT_VIRTUALIZER, virtualizer);
...
JasperPrinter printer = JasperFillManager.fillReport(report, params, dataSource);
...
}
finally {
if (virtualizer != null) virtualizer.cleanup();
}
This will make the system remove the swap file when it's done with the report, and it will use the virtualizer to hold reports with more than 50 pages.
The JRGzipVirtualizer was another p.o.c. virtualizer meant for systems without disk access. The report page objects compress pretty well, so you can still make some big reports if you have a decent heap memory size.