camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Markus Wolf <markus.w...@nmmn.com>
Subject Re: Camel + ActiveMQ in Tomcat6
Date Tue, 24 Feb 2009 14:49:34 GMT
>> What does the path to the GC root look like for the classloader object
>> that couldn't be unloaded in Eclipse MAT?
> 
> it may need a little to recreate the setup we had when I discovered the
> leak but I will do so.
> I will attach a jmap created memory dump then and describe the leak as
> good as I can.
> 
I've created a dump now. It was created the following way:
1) Start a plain tomcat without any webapp
2) Deploy our application (which creates an ActiveMQConnectionFactory)
3) Undeploy our application
4) Create the dump with jmap: jmap -dump:format=b,file=heap.bin <processid>

The gc-roots show a reference from the webapp classloader to an
anonymous class created by the InactivyMonitor.
I've attached a screenshot of this, because the dump is too big to send
in a mail. I will upload it to a server where you can download and
inspect it if you need. Send me a link if I should do so.

I've also opened a JIRA at ActiveMQ for this:
https://issues.apache.org/activemq/browse/AMQ-2138

Regards,
Markus

> 
> 
>> Markus Wolf wrote:
> 
>>>>>> we tried this but it throws this Exception during creation of the
>>>>>> ActiveMQConnectionFactory:
>>>>>>       
>>>>> Tried what exactly? Running the camel-activemq-web war works fine for
>>>>> me.
>>>>>
>>>>>     
>> I've tried to put only the activemq libraries into my tomcat common
>> classpath and all camel dependencies including camel-core into my
>> webapp. That caused the exeception I mentioned.
> 
> 
>>>>>> Caused by: java.lang.NoClassDefFoundError:
>>>>>> org/apache/activemq/management/JMSStatsImpl
>>>>>>       
>>>>> Looks like missing dependencies. Are you using maven to resolve the
>>>>> dependencies?
>>>>>
>>>>>     
>> That file resides in the activemq-core.jar. I've checked that. And that
>> file is inside the tomcat common classpath. Maybe I missconfigured
>> something here... :/
> 
> 
>>>>> [snip]
>>>>>
>>>>>    
>>>>>> I guess there is currently no way to use ActiveMQ in an embedded
way
>>>>>> which does not have classloader leaks.
>>>>>>       
>>>>> I don't see any evidence of a class loader leak?
>>>>>
>>>>>     
>> Ok, let me explain it a bit more in detail.
>> The ActiveMQConnectionFactory and the TcpTransport (some other classes
>> also) create ThreadPools (to be excact ScheduledThreadPools from Java
>> Concurrent). That thread pools are configured with custom
>> ThreadFactories to set the created Threads to daemon behaviour.
>> When we undeploy our application then the ThreadPool classes keep a
>> reference to the ThreadFactories. This factories are loaded by tomcats
>> webapp classloader whereas the ThreadPool classes are loaded by the
>> bootstrap classloader of the JDK.
>> Therefore the webapp classloader could not be unloaded.
> 
>> I'm not a classloader expert but I check this with the eclipse memory
>> analyzer tool (http://www.eclipse.org/mat), because I wanted to see
>> which part of our application keeps the PermGen.
> 
>> Markus
> 

-- 
NMMN - New Media Markets & Networks GmbH
Geschäftsführung: Kfm. Michael Schütt
Finanzamt HH-Altona UStID DE 812 699 852  HRB 71102 Hamburg
HypoVereinsbank  -   BLZ 200 300 00  -  Konto-Nr. 156 29 82

http://www.nmmn.com               Tel.: +49 40 284 118 -0
Langbehnstrasse 6                 Entwicklung:         -720
22761 Hamburg                     Fax:                 -999

Rufen Sie uns kostenlos an: http://www.nmmn.com/call/software

Mime
View raw message