You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by "Mike L." <pa...@hotmail.com> on 2011/04/30 00:09:34 UTC

Possible Memory Leak when JMX is enabled

All:

Our production servers are experiencing a fairly severe 
memory leak - it takes about 12 days to get the dreaded 
OutOfMemoryExceptions.
We use linux (CentOS 5.x)
Sun 1.6.0_22 JDK
Camel 2.4.0
ActiveMQ 5.3.1
JBoss 4.2.1.GA (I know! It's old.)

I've attached two screenprints from the Eclipse Memory Analyzer Tool (MAT).
The first, ShortestPath, shows at the bottom the DefaultManagementAgent as part of the problem; while at the top you'll see
EDU.oswego.cs.dl.util.concurrent.ConcurrentReaderHashMap$Entry.
I'm not sure which is the "real" culprit.

Something else: when I go to the JMX console in JBoss I do not see anything at all related to Camel. No endpoints, nothing!

So, naturally I disabled JMX in Camel and the problem appears to have gone away.

Before I disabled JMX in Camel (the default/example configurations have this enabled by default) I did nothing with respect to: 


-Dorg.apache.camel.jmx.usePlatformMBeanServer=True




Or, by adding a jmxAgent element inside the camelContext element in Spring configuration:


<camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">
  <jmxAgent id="agent" usePlatformMBeanServer="true"/>
    ...
</camelContext>


However, since this is true by default, I'm confused as to why nothing Camel related was showing up in the JMX console.

Any thoughts, comments, advice would be welcome.

TIA,

Mike L. (aka patzerbud) 		 	   		  

Re: Possible Memory Leak when JMX is enabled

Posted by suman <pr...@gmail.com>.
Hello Guys,
Just updating this message as i experienced similar memory leak.But it was
very obvious that it was because of 
1)enabling JMX.
so i disabled it in camelcontext
 <jmxAgent id="agent" disabled="true" />

2)i was starting and stopping routes dynamically and when i used to stop,i
just used to call stopRoute().
Now iam calling removeRoute() as well to free up resources.

Now there is no increase in old generation.Also on a different note,try
Eclipse memory Analyzer if you haven't allready.Its awesome.Also install
VisualGC plugin for VisualVM if you havent allready.

Cheers




--
View this message in context: http://camel.465427.n5.nabble.com/Possible-Memory-Leak-when-JMX-is-enabled-tp4359979p5091516.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Possible Memory Leak when JMX is enabled

Posted by Christian Müller <ch...@gmail.com>.
Mike,
some weeks ago another user had also reported a memory consumption problem
by using JMX and creating many endpoints on the fly [1].
Do you do similar things?

[1]
http://camel.465427.n5.nabble.com/Memory-leak-in-camel-mail-component-td3364793.html

Christian

Re: Possible Memory Leak when JMX is enabled

Posted by Claus Ibsen <cl...@gmail.com>.
What do you do in your routes?

On Sat, Apr 30, 2011 at 12:09 AM, Mike L. <pa...@hotmail.com> wrote:
> All:
>
> Our production servers are experiencing a fairly severe memory leak - it
> takes about 12 days to get the dreaded OutOfMemoryExceptions.
> We use linux (CentOS 5.x)
> Sun 1.6.0_22 JDK
> Camel 2.4.0
> ActiveMQ 5.3.1
> JBoss 4.2.1.GA (I know! It's old.)
>
> I've attached two screenprints from the Eclipse Memory Analyzer Tool (MAT).
> The first, ShortestPath, shows at the bottom the DefaultManagementAgent as
> part of the problem; while at the top you'll see
> EDU.oswego.cs.dl.util.concurrent.ConcurrentReaderHashMap$Entry.
> I'm not sure which is the "real" culprit.
>
> Something else: when I go to the JMX console in JBoss I do not see anything
> at all related to Camel. No endpoints, nothing!
>
> So, naturally I disabled JMX in Camel and the problem appears to have gone
> away.
>
> Before I disabled JMX in Camel (the default/example configurations have this
> enabled by default) I did nothing with respect to:
>
> -Dorg.apache.camel.jmx.usePlatformMBeanServer=True
>
>
> Or, by adding a jmxAgent element inside the camelContext element in Spring
> configuration:
>
> <camelContext id="camel" xmlns="http://camel.apache.org/schema/spring">
>   <jmxAgent id="agent" usePlatformMBeanServer="true"/>
>     ...
> </camelContext>
>
> However, since this is true by default, I'm confused as to why nothing Camel
> related was showing up in the JMX console.
>
> Any thoughts, comments, advice would be welcome.
>
> TIA,
>
> Mike L. (aka patzerbud)



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