camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <>
Subject Re: Memory leak in camel mail component
Date Fri, 04 Feb 2011 15:06:37 GMT
On Fri, Feb 4, 2011 at 4:00 PM, Marco Crivellaro
<> wrote:
> Hi All,
> I am working together with Sri in a project which makes an extensive use of
> camel (you've seen some posts from me in the past).
> I can confirm the number of endpoints being created grows constantly using
> any protocol,
> with our system we are serving a very high number of endpoints and at the
> moment we are forced to restart our application every now and then to free
> up memory use. Is there a way to unreference all endpoints and therefore
> allow them to be deallocated by garbage collector?

Are you using JMX?
If so you can disable JMX then it ought to run.

I think the problem is that endpoints gets enlisted in JMX and thus it grows.
Camel itself just cache at most 1000 endpoints and thus it shouldn't
be a big deal.

That said I have though of only enlisting resources in JMX during
starting a route.
That ensures only "static" beans gets enlisted.
Then all the dynamic endpoints and producers wont be enlisted.
Although producers are not enlisted today.

And many time you can put the "dynamic" parts of the endpoints as
headers to the message. Frankly where it belong.
Eg a To recipient in a mail message belongs as a message header, and
not as an endpoint uri parameter.

And keep the endpoint less dynamic.

> I think the issue described by Sri with mail component is a different
> problem as the leak is shown only when using recipient list, if we use a for
> cicle the memory use is not growing (hence the same endpoint is used).
> --
> View this message in context:
> Sent from the Camel - Users mailing list archive at

Claus Ibsen
Twitter: davsclaus
Author of Camel in Action:

View raw message