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 Jens Kühnberger <Ku...@web.de> on 2001/11/03 23:38:33 UTC

Out of memory problem

Hi

I got the problem that the .fo file I create in my servlet allocates so 
much memory to render to PDF, until I get an OutOfMemory Error.
I posted this problem before and I got the following good advices:

> a) starting java with -Xms64M -Xmx320M 

Now I start it with -Xms64M -Xmx256M

> c) until the end of a page sequence where most of the objects in memory for
>   that page sequence are released, then it starts again

Now I changed my stylesheet so, that every page has it's own page sequence

But the problem remained.
Before the rendering my application allocates 80 MB. In the process of 
rendering ( driver.render( doc ); )
the allocated memory goes up to 260MB until I get the OutOfMemory Error.

The relevant part of my servlet look like that:

    ByteArrayOutputStream out = new ByteArrayOutputStream();
    MessageHandler.setOutputMethod( MessageHandler.NONE );

    Driver driver = new Driver();
    driver.setRenderer( Driver.RENDER_PDF );
    try {
      driver.setOutputStream( out );
      driver.render( doc );
    }
    catch ( Exception ex ) {
      cat.error(ex);
      try {
        out.close();
      }
      catch ( IOException e ) {
      }
    }


Jens





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