You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Tobias Emmerich <to...@gmx.de> on 2009/05/27 16:04:29 UTC

convertBodyTo heap problem

Hallo,

we use the new camel version 2.0-M1 on our project. With this version we
have a problem with java heap sapce. After looking about the problem i found
out that by using <convertBodyTo> the heap will grow with every xml file we
read. 

I have tested this with a short example:

<endpoint id="camel.Input"
uri="file://${camel.Input}?sortBy=ignoreCase:file:name&amp;preMove=${camel.Archiv}&amp;initialDealy=1000&amp;delay=500"
/>

<route>
 <from ref="camel.Input">
 <convertBodyTo type="java.lang.String">
 <to uri="bean:orderProcessorDummy?method=processOrder"/>
</route>

<bean id="orderProcessorDummy" class="OrderProcessorDummy"></bean>

The class orderProcessorDummy makes nothing and looks like this:

public class OrderProcessorDummy{

 public void processOrder(XMLFILE xml){

  }
}

I hope you can help us to find the bug and fix him ;).

Thanks for help

Tobias



-- 
View this message in context: http://www.nabble.com/convertBodyTo-heap-problem-tp23743181p23743181.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: convertBodyTo heap problem

Posted by Willem Jiang <wi...@gmail.com>.
Well spot.
I think Claus will be happy to see this quick feed back for the batch
consumer.

Willem

Christian Schneider wrote:
> Hi Claus,
> 
> Tobias is a colleague of me at EnBW.
> 
> I have been able to reproduce the problem with the current HEAD of
> camel-core. The problem is with the batch processing as all exchanges
> are stored in a list. I have opened an issue and attached a test and a
> patch:
> https://issues.apache.org/activemq/browse/CAMEL-1652
> 
> Greetings
> 
> Christian
> 


Re: convertBodyTo heap problem

Posted by Claus Ibsen <cl...@gmail.com>.
On Wed, May 27, 2009 at 11:50 PM, Christian Schneider
<ch...@die-schneider.net> wrote:
> Hi Claus,
>
> Tobias is a colleague of me at EnBW.
>
> I have been able to reproduce the problem with the current HEAD of
> camel-core. The problem is with the batch processing as all exchanges are
> stored in a list. I have opened an issue and attached a test and a patch:
> https://issues.apache.org/activemq/browse/CAMEL-1652
Hi

Yeah I thought of that myself last night before tumbling into the bed.
Glad others had the same thought and time to create a patch for it.

It should be applied for the other BatchConsumers in eg: Mail, iBatis
and whatelse.



>
> Greetings
>
> Christian
>
> --
>
> Christian Schneider
> ---
> http://www.liquid-reality.de
>
>
>
> Claus Ibsen schrieb:
>>
>> Hi
>>
>> Do you mind trying the SNAPSHOT version of 2.0?
>>
>> A million things have been fixed since 2.0m1.
>>
>> Details how to get it at the downloads page
>> http://camel.apache.org/download.html
>>
>>
>> On Wed, May 27, 2009 at 4:04 PM, Tobias Emmerich <to...@gmx.de>
>> wrote:
>>
>>>
>>> Hallo,
>>>
>>> we use the new camel version 2.0-M1 on our project. With this version we
>>> have a problem with java heap sapce. After looking about the problem i
>>> found
>>> out that by using <convertBodyTo> the heap will grow with every xml file
>>> we
>>> read.
>>>
>>> I have tested this with a short example:
>>>
>>> <endpoint id="camel.Input"
>>>
>>> uri="file://${camel.Input}?sortBy=ignoreCase:file:name&amp;preMove=${camel.Archiv}&amp;initialDealy=1000&amp;delay=500"
>>> />
>>>
>>> <route>
>>>  <from ref="camel.Input">
>>>  <convertBodyTo type="java.lang.String">
>>>  <to uri="bean:orderProcessorDummy?method=processOrder"/>
>>> </route>
>>>
>>> <bean id="orderProcessorDummy" class="OrderProcessorDummy"></bean>
>>>
>>> The class orderProcessorDummy makes nothing and looks like this:
>>>
>>> public class OrderProcessorDummy{
>>>
>>>  public void processOrder(XMLFILE xml){
>>>
>>>  }
>>> }
>>>
>>> I hope you can help us to find the bug and fix him ;).
>>>
>>> Thanks for help
>>>
>>> Tobias
>>>
>>>
>>>
>>> --
>>> View this message in context:
>>> http://www.nabble.com/convertBodyTo-heap-problem-tp23743181p23743181.html
>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>>
>>>
>>>
>>
>>
>>
>>
>
>
>



-- 
Claus Ibsen
Apache Camel Committer

Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Re: convertBodyTo heap problem

Posted by Christian Schneider <ch...@die-schneider.net>.
Hi Claus,

Tobias is a colleague of me at EnBW.

I have been able to reproduce the problem with the current HEAD of 
camel-core. The problem is with the batch processing as all exchanges 
are stored in a list. I have opened an issue and attached a test and a 
patch:
https://issues.apache.org/activemq/browse/CAMEL-1652

Greetings

Christian

-- 

Christian Schneider
---
http://www.liquid-reality.de



Claus Ibsen schrieb:
> Hi
>
> Do you mind trying the SNAPSHOT version of 2.0?
>
> A million things have been fixed since 2.0m1.
>
> Details how to get it at the downloads page
> http://camel.apache.org/download.html
>
>
> On Wed, May 27, 2009 at 4:04 PM, Tobias Emmerich <to...@gmx.de> wrote:
>   
>> Hallo,
>>
>> we use the new camel version 2.0-M1 on our project. With this version we
>> have a problem with java heap sapce. After looking about the problem i found
>> out that by using <convertBodyTo> the heap will grow with every xml file we
>> read.
>>
>> I have tested this with a short example:
>>
>> <endpoint id="camel.Input"
>> uri="file://${camel.Input}?sortBy=ignoreCase:file:name&amp;preMove=${camel.Archiv}&amp;initialDealy=1000&amp;delay=500"
>> />
>>
>> <route>
>>  <from ref="camel.Input">
>>  <convertBodyTo type="java.lang.String">
>>  <to uri="bean:orderProcessorDummy?method=processOrder"/>
>> </route>
>>
>> <bean id="orderProcessorDummy" class="OrderProcessorDummy"></bean>
>>
>> The class orderProcessorDummy makes nothing and looks like this:
>>
>> public class OrderProcessorDummy{
>>
>>  public void processOrder(XMLFILE xml){
>>
>>  }
>> }
>>
>> I hope you can help us to find the bug and fix him ;).
>>
>> Thanks for help
>>
>> Tobias
>>
>>
>>
>> --
>> View this message in context: http://www.nabble.com/convertBodyTo-heap-problem-tp23743181p23743181.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>
>>
>>     
>
>
>
>   



Re: convertBodyTo heap problem

Posted by Claus Ibsen <cl...@gmail.com>.
Hi

Do you mind trying the SNAPSHOT version of 2.0?

A million things have been fixed since 2.0m1.

Details how to get it at the downloads page
http://camel.apache.org/download.html


On Wed, May 27, 2009 at 4:04 PM, Tobias Emmerich <to...@gmx.de> wrote:
>
> Hallo,
>
> we use the new camel version 2.0-M1 on our project. With this version we
> have a problem with java heap sapce. After looking about the problem i found
> out that by using <convertBodyTo> the heap will grow with every xml file we
> read.
>
> I have tested this with a short example:
>
> <endpoint id="camel.Input"
> uri="file://${camel.Input}?sortBy=ignoreCase:file:name&amp;preMove=${camel.Archiv}&amp;initialDealy=1000&amp;delay=500"
> />
>
> <route>
>  <from ref="camel.Input">
>  <convertBodyTo type="java.lang.String">
>  <to uri="bean:orderProcessorDummy?method=processOrder"/>
> </route>
>
> <bean id="orderProcessorDummy" class="OrderProcessorDummy"></bean>
>
> The class orderProcessorDummy makes nothing and looks like this:
>
> public class OrderProcessorDummy{
>
>  public void processOrder(XMLFILE xml){
>
>  }
> }
>
> I hope you can help us to find the bug and fix him ;).
>
> Thanks for help
>
> Tobias
>
>
>
> --
> View this message in context: http://www.nabble.com/convertBodyTo-heap-problem-tp23743181p23743181.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>



-- 
Claus Ibsen
Apache Camel Committer

Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus

Re: convertBodyTo heap problem

Posted by Tobias Emmerich <to...@gmx.de>.
Hallo,

we have found out a fix for the problem. We think the problem is that camel
do not free the exchange as long it found new files. 

The fix is like this:

<route>
 <from ref="camel.Input">
 <convertBodyTo type="java.lang.String">
 <to uri="bean:orderProcessorDummy?method=processOrder"/>
 <to uri="bean:cleanProcessor?method=clean" />
</route> 

The CleanProcessor class looks like this:

public class CleanProcessor {
  public void clean(Exchange exchange){
    exchange.getIn().setBody(null);
  }
}

After using the CleanProcessor we have got no heap memory problems.

greetings

Tobias
-- 
View this message in context: http://www.nabble.com/convertBodyTo-heap-problem-tp23743181p23743975.html
Sent from the Camel - Users mailing list archive at Nabble.com.