You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by CamelBumper01 <br...@yahoo.com> on 2011/07/22 02:08:17 UTC

LRUCache memory leak when using camel properties file

I'm presently using properties to populate my camelContext.xml file and my
camel spring container is running out of memory consistently.  When I use
MAT to evaluate the heap dump files it points to LRUCache in the
org.apache.camle.component.properties.PropertiesComponent as the problem.  

It appears that the LRUCache is not releasing memory and that a separate
instance of the properties is created for every route execution instance. 
Well that's what the heapdump appears to be indicating anyway.

I have a heapdump if that will help and I can recreate this issue at will.



--
View this message in context: http://camel.465427.n5.nabble.com/LRUCache-memory-leak-when-using-camel-properties-file-tp4621357p4621357.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: LRUCache memory leak when using camel properties file

Posted by CamelBumper01 <br...@yahoo.com>.
I'm using camel 2.7.1

here is a piece of my camelContext.xml file that is having the problem.


>From what I can tell, the problem is occurring inside the <split> tags and
that it is being exacerbated by the one to many activities associated with
the split.   It looks like the split is creating a separate camelContext
instance or referring to a cached camelContext instance that is not being
released.



	<camelContext id="camelContext" autoStartup="{{camel.autostart}}"
		xmlns="http://camel.apache.org/schema/spring">
		<jmxAgent id="agent" createConnector="true" registryPort="{{jmx.port}}" />
		<onException>
			<exception>java.lang.NullPointerException</exception>
			<handled>
				<constant>true</constant>
			</handled>
			<to uri="log:xml?level=ERROR" />
		</onException>
		<onException>
			<exception>java.sql.SQLRecoverableException</exception>
			<handled>
				<constant>true</constant>
			</handled>
			<to uri="log:xml?level=ERROR" />
		</onException>
		<route id="Poller" startupOrder="2" autoStartup="{{route1.autostart}}">
			<from uri="{{poller.timer}}" />
			<bean ref="SharedLock" method="lock" />
			<choice>
				<when>
					<simple>${in.header.inControl} == locked</simple>
					<setHeader headerName="MeasurementList">
						<spel>#{{"PollerRead","PollerTotal"}}</spel>
					</setHeader>
					<bean ref="Measurements" method="startMeasurements" />
					<setBody>
						<simple>${properties:event.table.query}</simple>
					</setBody>
					<bean ref="ProcessOutputBody" />
					<to uri="{{jdbc.raw.event.reader}}" />
					<setHeader headerName="Measurement">
						<constant>PollerRead</constant>
					</setHeader>
					<bean ref="Measurements" method="endMeasurement" />
					<wireTap uri="direct:measurement" />
					<split parallelProcessing="true">
						<simple>${body}</simple>
						<to uri="{{raw.event.publisher}}" />
						<setBody>
							<simple>${properties:event.table.update}${body[ENTRY_ID]}
							</simple>
						</setBody>
						<bean ref="ProcessOutputBody" />
						
						<to uri="{{jdbc.provider}}" />
					</split>
					<bean ref="SharedLock" method="unlock" />
					<setHeader headerName="Measurement">
						<constant>PollerTotal</constant>
					</setHeader>
					<bean ref="Measurements" method="endMeasurement" />
					<wireTap uri="direct:measurement" />
					<bean ref="Measurements" method="showMeasurements" />
					
				</when>
			</choice>
		</route>




--
View this message in context: http://camel.465427.n5.nabble.com/LRUCache-memory-leak-when-using-camel-properties-file-tp4621357p4624798.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: LRUCache memory leak when using camel properties file

Posted by bvahdat <ba...@swissonline.ch>.
Hi,

That fears me, as I'm already running with camel 2.8.0 in a production
environment since 2 days (JBoss 5.1.0).

I've got my routes in Java-DSL and the relevant spring config is something
like  http://camel.465427.n5.nabble.com/file/n4622462/xyz.xml xyz.xml 

Am I affected by this issue? The only reason why I used the the
propertyPlaceholder was just because of the configuration ability of the
port, just for the case if the port is already in use on the production box.

I can't go for a 2.9-SNAPSHOT nightly-build as it seems too risky to me.

Should I really disable caching and roll-out a patch release of the
application.

Any advice?

Regards, Babak


--
View this message in context: http://camel.465427.n5.nabble.com/LRUCache-memory-leak-when-using-camel-properties-file-tp4621357p4622462.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: LRUCache memory leak when using camel properties file

Posted by CamelBumper01 <br...@yahoo.com>.
Thanks Claus

--
View this message in context: http://camel.465427.n5.nabble.com/LRUCache-memory-leak-when-using-camel-properties-file-tp4621357p4635464.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: LRUCache memory leak when using camel properties file

Posted by Claus Ibsen <cl...@gmail.com>.
On Mon, Jul 25, 2011 at 9:58 PM, CamelBumper01 <br...@yahoo.com> wrote:
> Claus,
>
> Thanks for identifying this.  I have removed the properties from my
> camelContext.xml file and the memory leak has vanished.  Can you make this
> correction 2.8.0 or 2.8.1?
>

Its fixed on trunk and will be in the next release Camel 2.9.0 or
possible a patch release of Camel 2.8.1.


> Bret
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/LRUCache-memory-leak-when-using-camel-properties-file-tp4621357p4632168.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Re: LRUCache memory leak when using camel properties file

Posted by CamelBumper01 <br...@yahoo.com>.
Claus,

Thanks for identifying this.  I have removed the properties from my
camelContext.xml file and the memory leak has vanished.  Can you make this
correction 2.8.0 or 2.8.1?

Bret

--
View this message in context: http://camel.465427.n5.nabble.com/LRUCache-memory-leak-when-using-camel-properties-file-tp4621357p4632168.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: LRUCache memory leak when using camel properties file

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

I managed to reproduce the issue and created a ticket
https://issues.apache.org/jira/browse/CAMEL-4261

You can disable the cache on the properties component. Then it will
not take up memory. However it has a limit of 1000 entries so it ought
not to eat up memory.


On Fri, Jul 22, 2011 at 8:51 AM, Claus Ibsen <cl...@gmail.com> wrote:
> Hi
>
> What version of Camel are you using?
>
> And how have you configured/defined the PropertiesComponent.
>
>
>
> On Fri, Jul 22, 2011 at 2:08 AM, CamelBumper01 <br...@yahoo.com> wrote:
>> I'm presently using properties to populate my camelContext.xml file and my
>> camel spring container is running out of memory consistently.  When I use
>> MAT to evaluate the heap dump files it points to LRUCache in the
>> org.apache.camle.component.properties.PropertiesComponent as the problem.
>>
>> It appears that the LRUCache is not releasing memory and that a separate
>> instance of the properties is created for every route execution instance.
>> Well that's what the heapdump appears to be indicating anyway.
>>
>> I have a heapdump if that will help and I can recreate this issue at will.
>>
>>
>>
>> --
>> View this message in context: http://camel.465427.n5.nabble.com/LRUCache-memory-leak-when-using-camel-properties-file-tp4621357p4621357.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>
>
>
>
> --
> Claus Ibsen
> -----------------
> FuseSource
> Email: cibsen@fusesource.com
> Web: http://fusesource.com
> Twitter: davsclaus, fusenews
> Blog: http://davsclaus.blogspot.com/
> Author of Camel in Action: http://www.manning.com/ibsen/
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Re: LRUCache memory leak when using camel properties file

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

What version of Camel are you using?

And how have you configured/defined the PropertiesComponent.



On Fri, Jul 22, 2011 at 2:08 AM, CamelBumper01 <br...@yahoo.com> wrote:
> I'm presently using properties to populate my camelContext.xml file and my
> camel spring container is running out of memory consistently.  When I use
> MAT to evaluate the heap dump files it points to LRUCache in the
> org.apache.camle.component.properties.PropertiesComponent as the problem.
>
> It appears that the LRUCache is not releasing memory and that a separate
> instance of the properties is created for every route execution instance.
> Well that's what the heapdump appears to be indicating anyway.
>
> I have a heapdump if that will help and I can recreate this issue at will.
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/LRUCache-memory-leak-when-using-camel-properties-file-tp4621357p4621357.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/