You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-dev@xmlgraphics.apache.org by Chetan Vig <ch...@yahoo.com> on 2001/05/08 15:24:19 UTC

FOP Out of memory

Hi Mark,

I am also running through the same issue of Out of memory error while
generating large PDF's.
Please let me know what you are thinking of doing in PDFRenderer.java.

Thanks,

-Chetan


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org


Re: FOP Out of memory

Posted by Chetan Vig <ch...@yahoo.com>.
Thanks Eric...I'll try that

-Chetan

Eric Richardson wrote:

> Chetan Vig wrote:
> >
> > Hi Mark,
> >
> > I am also running through the same issue of Out of memory error while
> > generating large PDF's.
> > Please let me know what you are thinking of doing in PDFRenderer.java.
> >
> If you haven't already boosted the max memory size of the VM, look at
> the second option to java. 64m is the default memory.
>
> -Xmsn Specify the initial size of the memory allocation pool. This value
> must greather than
>       1000. To multiply the value by 1000, append the letter k. To
> multiply the value by 1
>        million, append the letter m. The default value is 1m
>
> -Xmxn Specify the maximum size of the memory allocation pool. This value
> must greather than
>       1000. To multiply the value by 1000, append the letter k. To
> multiply the value by 1
>       million, append the letter m. The default value is 64m.
>
> Hope this helps,
> Eric
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
> For additional commands, email: fop-dev-help@xml.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org


Re: FOP Out of memory

Posted by Eric Richardson <er...@milagrosoft.com>.
Chetan Vig wrote:
> 
> Hi Mark,
> 
> I am also running through the same issue of Out of memory error while
> generating large PDF's.
> Please let me know what you are thinking of doing in PDFRenderer.java.
>
If you haven't already boosted the max memory size of the VM, look at
the second option to java. 64m is the default memory.

-Xmsn Specify the initial size of the memory allocation pool. This value
must greather than
      1000. To multiply the value by 1000, append the letter k. To
multiply the value by 1
       million, append the letter m. The default value is 1m 

-Xmxn Specify the maximum size of the memory allocation pool. This value
must greather than
      1000. To multiply the value by 1000, append the letter k. To
multiply the value by 1
      million, append the letter m. The default value is 64m.

Hope this helps,
Eric

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-dev-unsubscribe@xml.apache.org
For additional commands, email: fop-dev-help@xml.apache.org


Re: FOP Out of memory

Posted by Mark <ma...@plasticsoftware.com.au>.
Hi Chetan,

> I am also running through the same issue of Out of memory error while
> generating large PDF's.
> Please let me know what you are thinking of doing in PDFRenderer.java.

The solution Eric proposed (-Xmx, etc) won't work for unbounded document
sizes, which is what we need and what you might need. The problem seems
to be that FOP requires the entire FO document to be loaded into memory
before it can be printed. This effectively limits the document size to
some fraction of available RAM, which is no good if your primary
application needs to do something other than render documents (which is
the case for me). So for a FO file of more than a few tens of megabytes
I think that the solution is impractical.

My informal proposal is to treat the PDF output as a "stream" through
which multiple FO documents can be "printed" or appended. I do not
propose the ability to concatenate two different FO documents on a
single page, only that we can add additional pages to the PDF document
by adding additional FO documents. As an example of how I imagine this
would work, I would like to be able to do something like:

    PDFRenderer r = new PDFRenderer();
    driver.setRenderer(r);

    r.setOutputStream(someOutputStream);

    driver.buildFOTree(parser, new InputSource(new
FileReader(argv[0])));
    driver.format();
    driver.render();

    driver.reset();
    driver.buildFOTree(parser, new InputSource(new
FileReader(argv[0])));
    driver.format();
    driver.render();

    r.close();

At the moment, if you call format/render more than once you get two
complete PDF documents in the same file, when what I want is a single
complete PDF document consisting of two FO documents.

Since, at the moment, I know very little about the internals of the
PDFRenderer or PDF in general I don't know if any of this is feasible,
but when I get a chance to work on it (soon) I hope to be able to put
together a better proposal to present to the list. It might be that I am
talking complete kaka of course. :)

Cheers
Mark