Hi,

 

I've been creating PDF's with FOP for a while now, and recently I've had to create 1000+ every night in a batch process based on values in a database. So I have written a class which queries the database and passes all the necessary parameters (like which XSL file, XML file, and config file to use, and PDF file to write to) to an edited version of the Example class that comes with fop-0.20.5 (embedding\ExampleXML2PDF.java). So I instantiate that class in my new class which queries the database, and in a while(rs.next()){} loop it just calls the method in the Example class 1000+ times.

 

My problem however is that it slowly it eats up more and more memory. So after 500 pdf's or so its used more then the 500MB that I'm allowing the JVM to use and it dies with the following error:

 

Exception in thread "main" java.lang.OutOfMemoryError

        <<no stack trace available>>

       

Has anyone else successfully generated many PDF's in a batch like this? And if so did you have to do something to keep the memory from creeping upwardly? Does anyone have any suggestions about what I can do to make sure each iteration of the loop and hence each PDF doesn’t result in things being left in memory?

 

Thank you for any guidance you can provide.

 

Adrian.

 

Reply via email to