Title: Message
        You could always try calling the garbage collector after each loop.  Though the JVM does not have to do anything it might help reduce some of the memory.      
-----Original Message-----
From: Adrian Sobotta [mailto:[EMAIL PROTECTED]
Sent: 05 February, 2004 09:15
To: [EMAIL PROTECTED]
Subject: Batch Generation of PDF's

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.

 



--------------------------------------------------------------- -
Visit our Internet site at http://www.reuters.com

Get closer to the financial markets with Reuters Messaging - for more
information and to register, visit http://www.reuters.com/messaging

Any views expressed in this message are those of the individual
sender, except where the sender specifically states them to be
the views of Reuters Ltd.

Reply via email to