You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by GVS Srinivas <GV...@cramer.co.uk> on 2003/10/21 15:28:49 UTC

outofmemory error in batik transcoder

hi  all ,
i am  trying to transform a large svg into an jpg image using batik jpeg
transcoder and i am encoutering with outofmemoryerror.
when the transcode method is called from the jpegtranscoder.
1.jpegtrascoder---------->>>>>2.imagetranscoder.transcode()----------->>>>3.
Staticrenderer.repaint()----------->>>>>>4.Staticrenderer.updateWorkingBuffe
rs()------>>>>5. Raster.createWritableRaster().after this i am geting the
outofmemoryerror.
when i debug the code actual wrror is coming in the in databufferInt class.
 
would you please send me the code for correcting this problem in the batik
thanks a lot
GVS

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org


Re: outofmemory error in batik transcoder

Posted by Felicia Ionascu <fg...@ocegr.fr>.
Hi again,
I think this is not a good way to go. There may be memory constraints in 
the system - like in my case: 3Mb for a 300dpi A4 TIFF - that don't 
allow any extra memory for Java. There are applications where the 
rasterization is only marginal and allowing too much memory may have 
side effects elsewhere.
Felicia



Thomas DeWeese wrote:
> GVS Srinivas wrote:
> 
>> hi  all ,
>> i am  trying to transform a large svg into an jpg image using batik jpeg
>> transcoder and i am encoutering with outofmemoryerror.
> 
> 
>    I think you just want to give Java some extra memory.  The simplest
> way to do this is with the command line switch: -Xmx256m  Which will give
> Java 256MB of memory to work with compared with the default of around 64MB.
> 
>> when the transcode method is called from the jpegtranscoder.
>> 1.jpegtrascoder---------->>>>>2.imagetranscoder.transcode()----------->>>>3. 
>>
>> Staticrenderer.repaint()----------->>>>>>4.Staticrenderer.updateWorkingBuffe 
>>
>> rs()------>>>>5. Raster.createWritableRaster().after this i am geting the
>> outofmemoryerror.
>> when i debug the code actual wrror is coming in the in databufferInt 
>> class.
>>  
>> would you please send me the code for correcting this problem in the 
>> batik
>> thanks a lot
>> GVS
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
>> For additional commands, e-mail: batik-users-help@xml.apache.org
>>
>>
> 
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: batik-users-help@xml.apache.org
> 
> 
> 



---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org


Re: outofmemory error in batik transcoder

Posted by Thomas DeWeese <Th...@Kodak.com>.
GVS Srinivas wrote:

> hi  all ,
> i am  trying to transform a large svg into an jpg image using batik jpeg
> transcoder and i am encoutering with outofmemoryerror.

    I think you just want to give Java some extra memory.  The simplest
way to do this is with the command line switch: -Xmx256m  Which will give
Java 256MB of memory to work with compared with the default of around 64MB.

> when the transcode method is called from the jpegtranscoder.
> 1.jpegtrascoder---------->>>>>2.imagetranscoder.transcode()----------->>>>3.
> Staticrenderer.repaint()----------->>>>>>4.Staticrenderer.updateWorkingBuffe
> rs()------>>>>5. Raster.createWritableRaster().after this i am geting the
> outofmemoryerror.
> when i debug the code actual wrror is coming in the in databufferInt class.
>  
> would you please send me the code for correcting this problem in the batik
> thanks a lot
> GVS
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: batik-users-help@xml.apache.org
> 
> 




---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org


Re: outofmemory error in batik transcoder

Posted by Thomas DeWeese <Th...@Kodak.com>.
Felicia Ionascu wrote:

> Hi,
> I had the same problem several months ago, you can use the 
> TiledImageTranscoder instead of your JPEG transcoder, of course you need 
> to change "TIF" to "JPEG" in the code. This transcoder doesn't use 
> BufferedImages but RenderedImages, so it decreases dramatically the 
> memory consumption.
> The source is in the "contrib" area of the CVS, thanks to Thomas.

   Actually, you can't just replace TIFF with JPEG in the code because
there is no JPEG encoder capable of taking a rendered image and transcoding
it to a JPEG file (Actually I think javax.imageio may have one but we
are currently based on JDK 1.3 so in that context we don't have it).

   But it is true that if you can switch to using TIFF then the tiled transcoder
is _much_ better for very large images.

> 
> Felicia
> 
> 
> 
> GVS Srinivas wrote:
> 
>> hi  all ,
>> i am  trying to transform a large svg into an jpg image using batik jpeg
>> transcoder and i am encoutering with outofmemoryerror.
>> when the transcode method is called from the jpegtranscoder.
>> 1.jpegtrascoder---------->>>>>2.imagetranscoder.transcode()----------->>>>3. 
>>
>> Staticrenderer.repaint()----------->>>>>>4.Staticrenderer.updateWorkingBuffe 
>>
>> rs()------>>>>5. Raster.createWritableRaster().after this i am geting the
>> outofmemoryerror.
>> when i debug the code actual wrror is coming in the in databufferInt 
>> class.
>>  
>> would you please send me the code for correcting this problem in the 
>> batik
>> thanks a lot
>> GVS
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
>> For additional commands, e-mail: batik-users-help@xml.apache.org
>>
>>
>>
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: batik-users-help@xml.apache.org
> 
> 




---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org


Re: outofmemory error in batik transcoder

Posted by Felicia Ionascu <fg...@ocegr.fr>.
Hi,
I had the same problem several months ago, you can use the 
TiledImageTranscoder instead of your JPEG transcoder, of course you need 
to change "TIF" to "JPEG" in the code. This transcoder doesn't use 
BufferedImages but RenderedImages, so it decreases dramatically the 
memory consumption.
The source is in the "contrib" area of the CVS, thanks to Thomas.

Felicia



GVS Srinivas wrote:
> hi  all ,
> i am  trying to transform a large svg into an jpg image using batik jpeg
> transcoder and i am encoutering with outofmemoryerror.
> when the transcode method is called from the jpegtranscoder.
> 1.jpegtrascoder---------->>>>>2.imagetranscoder.transcode()----------->>>>3.
> Staticrenderer.repaint()----------->>>>>>4.Staticrenderer.updateWorkingBuffe
> rs()------>>>>5. Raster.createWritableRaster().after this i am geting the
> outofmemoryerror.
> when i debug the code actual wrror is coming in the in databufferInt class.
>  
> would you please send me the code for correcting this problem in the batik
> thanks a lot
> GVS
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
> For additional commands, e-mail: batik-users-help@xml.apache.org
> 
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-users-help@xml.apache.org