Uploaded image for project: 'Batik'
  1. Batik
  2. BATIK-930

OutOfMemoryError, when zooming in svg document

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Resolution: Unresolved
    • Affects Version/s: 1.7
    • Fix Version/s: None
    • Component/s: GVT
    • Labels:
      None
    • Environment:
      Operating System: Windows XP
      Platform: PC

      Description

      We are using batik for displaying human bodies for locating their body parts. For realistic displaying we colorize the svg model with a graphic, which is embedded in svg document. The png-graphic is having a certain color gradient, for more realistic appearance.

      Problem:
      If we are zoom in serveral times (shift-right mouse pressed and move up, -Xmx256M) with this svg document [see attachment], we do gain a java.lang.OutOfMemoryError.

      TestProgram:
      public class JSVGCanvasDemo
      {
      public static void main(String[] P_args)

      { JFrame F_f = new JFrame("Batik"); JSVGCanvasDemo F_canvas = new JSVGCanvasDemo(); F_f.getContentPane().add(F_canvas.createSVGComponent()); F_f.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); F_f.setSize(400, 400); F_f.setVisible(true); }

      protected JSVGCanvas svgCanvas = new JSVGCanvas();

      public JSVGCanvasDemo()

      { // noop }

      public JComponent createSVGComponent()

      { final JPanel F_panel = new JPanel(new BorderLayout()); F_panel.add("Center", svgCanvas); svgCanvas.setURI("file:/D:/male_front.svg"); return F_panel; }

      }

      Stack:
      java.lang.OutOfMemoryError: Java heap space
      Dumping heap to java_pid1764.hprof ...
      Heap dump file created [19697489 bytes in 3.415 secs]
      -E-2009-12-17 15:45:46.887: java.lang.OutOfMemoryError: Java heap space
      at java.awt.image.DataBufferByte.<init>(DataBufferByte.java:42)
      at java.awt.image.Raster.createInterleavedRaster(Raster.java:253)
      at java.awt.image.Raster.createInterleavedRaster(Raster.java:194)
      at java.awt.image.ComponentColorModel.createCompatibleWritableRaster(ComponentColorModel.java:2808)
      at java.awt.image.BufferedImage.<init>(BufferedImage.java:409)
      at org.apache.batik.ext.awt.image.renderable.ClipRable8Bit.createRendering(ClipRable8Bit.java:158)
      at org.apache.batik.ext.awt.image.GraphicsUtil.drawImage(GraphicsUtil.java:448)
      at org.apache.batik.gvt.AbstractGraphicsNode.paint(AbstractGraphicsNode.java:549)
      at org.apache.batik.gvt.CompositeGraphicsNode.primitivePaint(CompositeGraphicsNode.java:165)
      at org.apache.batik.gvt.AbstractGraphicsNode.paint(AbstractGraphicsNode.java:509)
      at org.apache.batik.gvt.CompositeGraphicsNode.primitivePaint(CompositeGraphicsNode.java:165)
      at org.apache.batik.gvt.CanvasGraphicsNode.primitivePaint(CanvasGraphicsNode.java:159)
      at org.apache.batik.gvt.AbstractGraphicsNode.paint(AbstractGraphicsNode.java:509)
      at org.apache.batik.gvt.CompositeGraphicsNode.primitivePaint(CompositeGraphicsNode.java:165)
      at org.apache.batik.gvt.filter.GraphicsNodeRed8Bit.genRect(GraphicsNodeRed8Bit.java:140)
      at org.apache.batik.gvt.filter.GraphicsNodeRed8Bit.copyData(GraphicsNodeRed8Bit.java:116)
      at org.apache.batik.ext.awt.image.rendered.TileCacheRed.genRect(TileCacheRed.java:63)
      at org.apache.batik.ext.awt.image.rendered.AbstractTiledRed.drawBlockInPlace(AbstractTiledRed.java:629)
      at org.apache.batik.ext.awt.image.rendered.AbstractTiledRed.drawBlock(AbstractTiledRed.java:544)
      at org.apache.batik.ext.awt.image.rendered.AbstractTiledRed.copyToRasterByBlocks(AbstractTiledRed.java:430)
      at org.apache.batik.ext.awt.image.rendered.AbstractTiledRed.copyData(AbstractTiledRed.java:297)
      at org.apache.batik.ext.awt.image.rendered.TranslateRed.copyData(TranslateRed.java:105)
      at org.apache.batik.gvt.renderer.StaticRenderer.repaint(StaticRenderer.java:394)
      at org.apache.batik.gvt.renderer.StaticRenderer.repaint(StaticRenderer.java:344)
      at org.apache.batik.swing.gvt.GVTTreeRenderer.run(GVTTreeRenderer.java:123)
      -E-2009-12-17 15:45:47.09: java.lang.OutOfMemoryError: Java heap space
      at java.awt.image.DataBufferByte.<init>(DataBufferByte.java:42)
      at java.awt.image.Raster.createInterleavedRaster(Raster.java:253)
      at java.awt.image.Raster.createInterleavedRaster(Raster.java:194)
      at java.awt.image.ComponentColorModel.createCompatibleWritableRaster(ComponentColorModel.java:2808)
      at java.awt.image.BufferedImage.<init>(BufferedImage.java:409)
      at org.apache.batik.ext.awt.image.renderable.ClipRable8Bit.createRendering(ClipRable8Bit.java:158)
      at org.apache.batik.ext.awt.image.GraphicsUtil.drawImage(GraphicsUtil.java:448)
      at org.apache.batik.gvt.AbstractGraphicsNode.paint(AbstractGraphicsNode.java:549)
      at org.apache.batik.gvt.CompositeGraphicsNode.primitivePaint(CompositeGraphicsNode.java:165)
      at org.apache.batik.gvt.AbstractGraphicsNode.paint(AbstractGraphicsNode.java:509)
      at org.apache.batik.gvt.CompositeGraphicsNode.primitivePaint(CompositeGraphicsNode.java:165)
      at org.apache.batik.gvt.CanvasGraphicsNode.primitivePaint(CanvasGraphicsNode.java:159)
      at org.apache.batik.gvt.AbstractGraphicsNode.paint(AbstractGraphicsNode.java:509)
      at org.apache.batik.gvt.CompositeGraphicsNode.primitivePaint(CompositeGraphicsNode.java:165)
      at org.apache.batik.gvt.filter.GraphicsNodeRed8Bit.genRect(GraphicsNodeRed8Bit.java:140)
      at org.apache.batik.gvt.filter.GraphicsNodeRed8Bit.copyData(GraphicsNodeRed8Bit.java:116)
      at org.apache.batik.ext.awt.image.rendered.TileCacheRed.genRect(TileCacheRed.java:63)
      at org.apache.batik.ext.awt.image.rendered.AbstractTiledRed.drawBlockInPlace(AbstractTiledRed.java:629)
      at org.apache.batik.ext.awt.image.rendered.AbstractTiledRed.drawBlock(AbstractTiledRed.java:544)
      at org.apache.batik.ext.awt.image.rendered.AbstractTiledRed.copyToRasterByBlocks(AbstractTiledRed.java:430)
      at org.apache.batik.ext.awt.image.rendered.AbstractTiledRed.copyData(AbstractTiledRed.java:297)
      at org.apache.batik.ext.awt.image.rendered.TranslateRed.copyData(TranslateRed.java:105)
      at org.apache.batik.gvt.renderer.StaticRenderer.repaint(StaticRenderer.java:394)
      at org.apache.batik.gvt.renderer.StaticRenderer.repaint(StaticRenderer.java:344)
      at org.apache.batik.swing.gvt.GVTTreeRenderer.run(GVTTreeRenderer.java:123)

        Attachments

        1. EmbeddedImage.jpg
          40 kB
          Helder Magalhães
        2. male_front.svg
          96 kB
          Georg Abfalter

          Activity

            People

            • Assignee:
              batik-dev@xmlgraphics.apache.org Batik Developer's Mailing list
              Reporter:
              georg.abfalter@systema.info Georg Abfalter
            • Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: