Fop
  1. Fop
  2. FOP-1172

Attempt to render xml with inline image causes java.lang.OutOfMemoryError

    Details

    • Type: Bug Bug
    • Status: Closed
    • Resolution: Fixed
    • Affects Version/s: 0.91
    • Fix Version/s: None
    • Component/s: pdf
    • Labels:
      None
    • Environment:
      Operating System: Windows XP
      Platform: PC
    • External issue ID:
      39285

      Description

      I've got two FO xml files that are identical except that one has two inline
      images. Running ExampleFO2PDF.java breaks on the line:

      // Start XSLT transformation and FOP processing
      transformer.transform(src, res);

      with a java.lang.OutOfMemoryError.

      This is happening in Eclipse Version: 3.1.0 with the memory cranked way up
      (-vmargs -Xms1024m -Xmx1024m -XX:PermSize=128m -XX:MaxPermSize=128m), these are
      small files (the "good" one is 166 KB -->
      http://hornet.titansolutions.com/fotestgood.xml, the "bad" one is 280 KB -->
      http://hornet.titansolutions.com/fotestbad.xml), so I don't believe it is the
      xml files themselves that are causing the OOM exception.

      The full stack trace:
      Exception in thread "main" java.lang.OutOfMemoryError
      at java.io.WinNTFileSystem.getBooleanAttributes(Native Method)
      at java.io.File.exists(File.java:702)
      at org.apache.fop.apps.FOURIResolver.resolve(FOURIResolver.java:67)
      at org.apache.fop.apps.FOUserAgent.resolveURI(FOUserAgent.java:549)
      at org.apache.fop.image.ImageFactory.loadImage(ImageFactory.java:204)
      at org.apache.fop.image.ImageLoader.loadImage(ImageLoader.java:54)
      at org.apache.fop.image.ContextImageCache.getImage(ImageFactory.java:441)
      at org.apache.fop.image.ImageFactory.getImage(ImageFactory.java:171)
      at org.apache.fop.fo.flow.ExternalGraphic.bind(ExternalGraphic.java:64)
      at org.apache.fop.fo.FObj.processNode(FObj.java:120)
      at org.apache.fop.fo.FOTreeBuilder.startElement(FOTreeBuilder.java:290)
      at
      org.apache.xalan.transformer.TransformerIdentityImpl.startElement(TransformerIdentityImpl.java:1072)
      at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
      at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
      at
      org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
      Source)
      at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
      Source)
      at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
      at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
      at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
      at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
      at
      org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:484)
      at ms.ExampleFO2PDF.convertFO2PDF(ExampleFO2PDF.java:84)
      at ms.ExampleFO2PDF.main(ExampleFO2PDF.java:138)

      Regards,
      Jason Brice

      1. fotestgood.xml
        165 kB
        Jason Brice
      2. fotestbad.xml
        280 kB
        Jason Brice

        Activity

        Jason Brice created issue -

          People

          • Assignee:
            fop-dev
            Reporter:
            Jason Brice
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development