camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ee7arh <andrew.hu...@2e-systems.com>
Subject Re: References to objects processed in routes held, eventually run out of memory
Date Fri, 20 Mar 2009 10:45:40 GMT

Hi,

Here it comes:

<!-- A local ativeMQ broker -->

<broker:broker useJmx="true" persistent="false" brokerName="localhost">
    <broker:transportConnectors>
        <broker:transportConnector name="tcp" uri="tcp://localhost:61616"/>
    </broker:transportConnectors>
</broker:broker>

<!-- Connection factory for ActiveMQ endpoints -->
<bean id="connectionFactoryActiveMQ"
    class="org.apache.activemq.ActiveMQConnectionFactory">
    <property name="brokerURL" value="vm://localhost"/>
</bean>

<!-- configure the Camel JMS consumer to use the ActiveMQ broker declared
above -->
<bean id="jms" class="org.apache.camel.component.jms.JmsComponent">
    <property name="connectionFactory" ref="connectionFactoryActiveMQ"/>
</bean>

and my camel context for completeness:

    <camel:camelContext id="camel"
xmlns="http://activemq.apache.org/camel/schema/spring">
        <camel:package>com.ee.berbe.mobile</camel:package>
            <!-- enable JMX connector so we can connect to the server and
browse mbeans -->
            <camel:jmxAgent id="agent" createConnector="true"
registryPort="1098"/>
    </camel:camelContext>

here is ActiveMQ starting:

[2009-03-19 11:28:37,785] org.apache.activemq.broker.BrokerService INFO   -
ActiveMQ 5.2.0 JMS Message Broker (localhost) is starting
[2009-03-19 11:28:37,785] org.apache.activemq.broker.BrokerService INFO   -
For help or more information please see: http://activemq.apache.org/
[2009-03-19 11:28:38,019]
org.apache.activemq.transport.TransportServerThreadSupport INFO   -
Listening for connections at: tcp://berint.2e-systems.com:61616
[2009-03-19 11:28:38,019] org.apache.activemq.broker.TransportConnector INFO  
- Connector tcp Started
[2009-03-19 11:28:38,024] org.apache.activemq.broker.BrokerService INFO   -
ActiveMQ JMS Message Broker (localhost,
ID:berint.2e-systems.com-47394-1237458517842-0:0) started
[2009-03-19 11:28:38,048] org.apache.activemq.broker.jmx.ManagementContext
INFO   - JMX consoles can connect to
service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi
[2009-03-19 11:28:38,464]
org.apache.activemq.transport.vm.VMTransportFactory DEBUG  - binding to
broker: localhost
[2009-03-19 11:28:38,465] org.apache.activemq.broker.TransportConnector INFO  
- Connector vm://localhost Started
[2009-03-19 11:28:38,496] org.ap

and camel starting:

[2009-03-19 11:28:34,031] org.apache.camel.util.MainSupport INFO   - Apache
Camel 1.6.0 starting
[2009-03-19 11:28:34,059]
org.springframework.context.support.ClassPathXmlApplicationContext INFO   -
Refreshing
org.springframework.context.support.ClassPathXmlApplicationContext@1df5a8f:
display name
[org.springframework.context.support.ClassPathXmlApplicationContext@1df5a8f];
startup date [Thu Mar 19 11:28:34 CET 2009]; root of context hierarchy
[2009-03-19 11:28:34,125]
org.springframework.beans.factory.xml.XmlBeanDefinitionReader INFO   -
Loading XML bean definitions from class path resource [camel-server.xml]
[2009-03-19 11:28:37,322]
org.springframework.context.support.ClassPathXmlApplicationContext INFO   -
Bean factory for application context
[org.springframework.context.support.ClassPathXmlA
pplicationContext@1df5a8f]:
org.springframework.beans.factory.support.DefaultListableBeanFactory@1fb3211
[2009-03-19 11:28:37,475]
org.springframework.context.support.ClassPathXmlApplicationContext INFO   -
Bean 'agent' is not eligible for getting processed by all BeanPostProcessors
(for examp
le: not eligible for auto-proxying)
[2009-03-19 11:28:37,499] org.apache.camel.impl.DefaultCamelContext INFO   -
JMX enabled. Using InstrumentationLifecycleStrategy.
[2009-03-19 11:28:37,513] org.apache.camel.spring.CamelContextFactoryBean
DEBUG  - JMXAgent enabled
[2009-03-19 11:28:37,513] org.apache.camel.spring.CamelContextFactoryBean
DEBUG  - Found JAXB created routes: []


Thanks
Andrew


Claus Ibsen-2 wrote:
> 
> Hi
> 
> That is fine. Then we know its AMQ loading the classes over and over
> again.
> 
> Can you post your AMQ configuration?
> 
> 
> On Fri, Mar 20, 2009 at 11:30 AM, ee7arh <andrew.hurst@2e-systems.com>
> wrote:
>>
>> Hi,
>>
>> I can confirm from JHat that only a single instance of the bean classes
>> are
>> loaded:
>>
>> 1 instance of class com.ee.berbe.mobile.external.EventMarshalling
>> 1 instance of class com.ee.berbe.mobile.external.EventRouter
>> 1 instance of class
>> com.ee.berbe.mobile.servicelogic.ServiceEventGenerator
>> 1 instance of class com.ee.berbe.mobile.servicelogic.ServiceDataRouter
>>
>> If I look in JHat at the total number of classes loaded and order it
>> ascending, if I search down for anything "camel" related I see:
>>
>> 121 instances of class
>> org.apache.camel.impl.converter.DefaultTypeConverter$TypeMapping
>>
>> If I do the same for "activemq" I see many more instances:
>>
>> 4466 instances of class org.apache.activemq.command.SessionId
>> 4456 instances of class org.apache.activemq.command.ConnectionId
>> 4382 instances of class org.apache.activemq.command.ProducerId
>> 3750 instances of class org.apache.activemq.util.ByteSequence
>> 3748 instances of class org.apache.activemq.command.MessageId
>> 3565 instances of class org.apache.activemq.command.ActiveMQQueue
>>
>> If I do the same for my internal object type I see:
>>
>> 3358 instances of class
>> com.ee.berbe.mobile.servicelogic.xxxx.events.external.TriggerCkiInvites
>>
>>
>> Does that answer your question satisfactorily or should I perform your
>> tests
>> to double check?
>>
>> Thanks
>> Andrew
>>
>>
>>
>>
>> Claus Ibsen-2 wrote:
>>>
>>> Hi
>>>
>>> Can you try using bean(Object, "methodname") in your route and pass in
>>> the same object, just to be sure its not Camel loading your bean
>>> constantly?
>>> And you are sure your bean in Spring XML is defined as singleton scope?
>>>
>>> In 2.0 I have adding TRACE logging to ObjectHelper.loadClass that loads
>>> a
>>> class.
>>> Then we will be able to TRACE if Camel is loading the same class over
>>> and over again.
>>>
>>>
>>>
>>> Another try is to use .process() instead of bean and put the code in
>>> there so you are sure the class is not loaded.
>>>
>>>
>>
>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/References-to-objects-processed-in-routes-held%2C-eventually-run-out-of-memory-tp22580791p22617746.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/
> 
> 

-- 
View this message in context: http://www.nabble.com/References-to-objects-processed-in-routes-held%2C-eventually-run-out-of-memory-tp22580791p22617943.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Mime
View raw message