You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Yong Wang <yw...@gmail.com> on 2015/09/17 17:14:43 UTC

Camel Unmarshal throwing heap space exception

Claus, could you elaborate on the splitter/streaming approach? I am running
into the same issue - gzip unmarshaling is done in memory and I am getting
this error when processing a large file:

java.lang.OutOfMemoryError: Java heap space

at java.util.Arrays.copyOf(Arrays.java:2271)[:1.7.0_45]

at
java.io.ByteArrayOutputStream.toByteArray(ByteArrayOutputStream.java:178)[:1.7.0_45]

at
org.apache.camel.impl.GzipDataFormat.unmarshal(GzipDataFormat.java:52)[142:org.apache.camel.camel-core:2.12.0.redhat-610379]

Here is my blueprint:

<camel:from uri="file://{{cmi.home}}/{{cmi.myworld.data.file.path}}?doneFileName=${file:name}.done"
/>

<camel:choice>
<camel:when>

<camel:simple>${file:name} regex ".*.gz$" </camel:simple>

<camel:unmarshal ref="gzip"/>

<camel:to

uri="file://{{cmi.home}}/{{cmi.myworld.file.path}}?fileName=${file:name.noext}&amp;doneFileName=${file:name}.done"
/>

<camel:log message="********processGzip:gzip file(${file:name})********" />

</camel:when>

<camel:otherwise>

<camel:log message="********processGzip:regular file(${file:name})********"
/>

<camel:to

uri="file://{{cmi.home}}/{{cmi.myworld.file.path}}?doneFileName=${file:name}.done"
/>

</camel:otherwise>

</camel:choice>

</camel:route>

I am using jboss-fuse-6.1.0.redhat-379


Thank you

Yong