I need to create a jasper report and export it to a .pdf file. This report needs to work for 100,000 records, each record will be a page. A page in this report will consist of one record from the database and two images uploaded via a scriptlet. This report will be generated from a web application on a tomcat server. The report works for up to 1,000 records then I run out of memory, which I have increased to -512MB. The virtualizer seems to be running great. When I ran it for 10,000 records I got a swapfile of 5.1GB but ran into an "Out of Memory" when my program tries to export the file to a .pdf. I looked into the code for JasperExportManager.exportReportToPdfFile(...) and noticed that it opens a FileOutputStream to export the file, that is good. The only thing I can think of is that that stream is not getting flushed often enough. Any help would be appreciated.