Just to let you know of our experience with pdf generation and memory problems ... We use 'apache fop' and/or 'ujac' for pdf generation, when the report is too big to be generated in memory, we instead start the task in another vm like :
...
        NSBundle bundle = NSBundle.bundleForClass(UtilitairesFOXML.class);
        URL url = bundle.pathURLForResourcePath("Java/FOXML.jar");
        String selfJar = url.getPath();
String cmd = "/usr/bin/java -classpath "+ selfJar + " org.apache.fop.apps.Fop -fo "+ foName +" -pdf "+ pdfName;
        Process p = Runtime.getRuntime().exec(cmd);
...

We have no memory problem of generating the report definition (xsl-fo) from our wocomponent, but transforming the definition to pdf in memory can cause problem on big report (at least with current version of apache's fop). That's why we had to do it externaly.

- jfv


Le 05-10-24, à 13:58, Chuck Hill a écrit :


On Oct 23, 2005, at 9:50 PM, Koksiong wrote:

hi,

i am facing a critical problem using WebPDFReports 1.0.

i used to generate quite a number of pdf daily, for each generation, it may contain up to 80 pages. for the first generation, it always works, but if i continue to generate the pdf , it just gives No Instance error. Once
it occurs, i need to restart the webobject instance.

Sounds like the application is running out of memory. Check the logs for "OutOfMemory".


the other modules are working except the pdf component. is it because the
number of pages generated is too big ?

The problem is at least related to that. I can see from your code below that the response is getting saved in the page cache, that means it will hang around consuming memory for quite some time. You will need to return it in some other manner or override Session.savePage() to avoid this going into the page cache. I would also suggest creating an EC on the PDF page and discarding it after use.


Chuck

please advice.

rgds,
koksiong

ps: the following are the code

    public WOActionResults goPrintAction()
    {
        generateVehicleDeliveryListPDF nextPage =
(generateVehicleDeliveryListPDF)pageWithName("generateVehicleDeliveryL istPDF");
                nextPage.setEc(ec);
nextPage.setATransactionArray(aTransactionArray.mutableClone());
                PDFPage pdfPage = (PDFPage)pageWithName("PDFPage");
HTML2PDFConvertor pdfConvertor = new HTML2PDFConvertor();
                pdfConvertor.createDocument("US
Letter",HTML2PDFConvertor.LandscapeOrientation);
                pdfConvertor.setPaperSize(new PaperSize(792,612));
                pdfConvertor.setTopMargin(5);
pdfConvertor.setLeftMargin(5);
                pdfConvertor.setRightMargin(5);
pdfConvertor.setBottomMargin(5);
                pdfConvertor.setPrintsVerticallyCentered(false);
                pdfPage.setConvertor(pdfConvertor);

                pdfPage.appendComponent(nextPage);

        return pdfPage;
    }

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/chill%40global- village.net

This email sent to [EMAIL PROTECTED]


--
Coming in 2006 - an introduction to web applications using WebObjects and Xcode http://www.global-village.net/wointro

Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems. http://www.global-village.net/products/practical_webobjects




_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/ jean_francois_veillette%40yahoo.ca

This email sent to [EMAIL PROTECTED]


http://www.freeiPods.com/?r=21419063

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to