Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 338687

Summary: memory exception , with svg file for a pdf export
Product: z_Archived Reporter: joel <joel.moreau>
Component: BIRTAssignee: Birt-ReportEngine-inbox <Birt-ReportEngine-inbox>
Status: CLOSED FIXED QA Contact: Xiaoying Gu <bluesoldier>
Severity: critical    
Priority: P3 CC: bluesoldier, jouyang, wyan, yChen
Version: unspecified   
Target Milestone: 3.7.0 RC2   
Hardware: PC   
OS: Windows XP   
Whiteboard: Obsolete
Attachments:
Description Flags
datas to reproduce the problem. In comment I put the result none

Description joel CLA 2011-03-02 10:33:42 EST
Build Identifier: Build id: M20100909-0800

I generate a pdf file using nesting.rptdesign. Each time the error arrive and nothing is generated


Reproducible: Always

Steps to Reproduce:
1. uncompress all the files in a directory c:\bug
2. open nesting.rptdesign in eclipse
3. generate a pdf file ( he will ask an xml file which is also in c:\bug)
Comment 1 joel CLA 2011-03-02 10:38:14 EST
Created attachment 190160 [details]
datas to reproduce the problem. In comment I put the result

java.lang.OutOfMemoryError: Java heap space
	at java.awt.image.DataBufferInt.<init>(Unknown Source)
	at java.awt.image.SinglePixelPackedSampleModel.createDataBuffer(Unknown Source)
	at java.awt.image.Raster.createWritableRaster(Unknown Source)
	at org.apache.batik.gvt.renderer.StaticRenderer.updateWorkingBuffers(Unknown Source)
	at org.apache.batik.gvt.renderer.StaticRenderer.repaint(Unknown Source)
	at org.apache.batik.gvt.renderer.StaticRenderer.repaint(Unknown Source)
	at org.apache.batik.transcoder.image.ImageTranscoder.transcode(Unknown Source)
	at org.apache.batik.transcoder.XMLAbstractTranscoder.transcode(Unknown Source)
	at org.apache.batik.transcoder.SVGAbstractTranscoder.transcode(Unknown Source)
	at org.eclipse.birt.report.engine.util.SvgFile.transSvgToArray(SvgFile.java:78)
	at org.eclipse.birt.report.engine.emitter.ImageReader.readImage(ImageReader.java:206)
	at org.eclipse.birt.report.engine.emitter.ImageReader.readImage(ImageReader.java:190)
	at org.eclipse.birt.report.engine.emitter.ImageReader.readImage(ImageReader.java:179)
	at org.eclipse.birt.report.engine.emitter.ImageReader.read(ImageReader.java:80)
	at org.eclipse.birt.report.engine.nLayout.area.impl.ImageAreaLayout.initialize(ImageAreaLayout.java:83)
	at org.eclipse.birt.report.engine.nLayout.area.impl.ImageAreaLayout.layout(ImageAreaLayout.java:72)
	at org.eclipse.birt.report.engine.nLayout.LayoutEngine.startContent(LayoutEngine.java:488)
	at org.eclipse.birt.report.engine.emitter.ContentEmitterAdapter.startImage(ContentEmitterAdapter.java:174)
	at org.eclipse.birt.report.engine.emitter.CompositeContentEmitter.startImage(CompositeContentEmitter.java:274)
	at org.eclipse.birt.report.engine.emitter.ContentEmitterUtil.startContent(ContentEmitterUtil.java:74)
	at org.eclipse.birt.report.engine.layout.html.HTMLTableLayoutEmitter.startContent(HTMLTableLayoutEmitter.java:146)
	at org.eclipse.birt.report.engine.emitter.ContentEmitterAdapter.startImage(ContentEmitterAdapter.java:174)
	at org.eclipse.birt.report.engine.emitter.ContentEmitterUtil.startContent(ContentEmitterUtil.java:74)
	at org.eclipse.birt.report.engine.layout.html.buffer.HTMLPageBuffer.startContent(HTMLPageBuffer.java:116)
	at org.eclipse.birt.report.engine.layout.html.buffer.TableBreakBuffer.startContent(TableBreakBuffer.java:287)
	at org.eclipse.birt.report.engine.layout.html.HTMLLeafItemLM.start(HTMLLeafItemLM.java:67)
	at org.eclipse.birt.report.engine.layout.html.HTMLAbstractLM.layout(HTMLAbstractLM.java:139)
	at org.eclipse.birt.report.engine.layout.html.HTMLBlockStackingLM.layoutNodes(HTMLBlockStackingLM.java:70)
	at org.eclipse.birt.report.engine.layout.html.HTMLStackingLM.layoutChildren(HTMLStackingLM.java:26)
	at org.eclipse.birt.report.engine.layout.html.HTMLAbstractLM.layout(HTMLAbstractLM.java:140)
	at org.eclipse.birt.report.engine.layout.html.HTMLInlineStackingLM.resumeLayout(HTMLInlineStackingLM.java:111)
	at org.eclipse.birt.report.engine.layout.html.HTMLInlineStackingLM.layoutNodes(HTMLInlineStackingLM.java:160)
Comment 2 Wei Yan CLA 2011-03-02 12:27:58 EST
The SVG's size is 6906*4619, if we convert it to 32 color image, it need 6906*4619*4=121M bytes. so you need increase the JVM's max memory and retry.
Comment 3 joel CLA 2011-03-02 12:30:35 EST
(In reply to comment #2)
> The SVG's size is 6906*4619, if we convert it to 32 color image, it need
> 6906*4619*4=121M bytes. so you need increase the JVM's max memory and retry.

I thought to this problem. I tried with 500M
Comment 4 Jun Ouyang CLA 2011-03-07 20:56:56 EST
Set as invalid, the conversion needs more than 121m which is for raw image data only. User should set the max memory size more than 500m for safe sake.
Comment 5 Xiaoying Gu CLA 2011-03-07 21:05:31 EST
Tried with -Xmx 500m, the attached example can be rendered to pdf.
Comment 6 joel CLA 2011-03-08 03:31:11 EST
I don't understand why we need 500M to draw a bitmap of a file of 3M. 
Why the dimensions of the canevas depend on dimensions of the svg file and not of maximal dimensions of the bitmap ?
Comment 7 Wei Yan CLA 2011-03-08 12:51:00 EST
Agree, let see if we can use the image's size to reduce the memory used to converting SVG.
Comment 8 Yu Chen CLA 2011-05-17 04:05:37 EDT
Won't fix.
Comment 9 Yu Chen CLA 2011-05-17 05:37:36 EDT
Please ignore comment 8. 
The bug is fixed. Please try our new 3.7 build.
Comment 10 Xiaoying Gu CLA 2011-05-18 04:22:51 EDT
Verified in daily build 3.7.0.v20100518-1359.
VM args in eclipse.ini:
-vmargs
-Xms40m
-Xmx256m