2012-02-29 83 views
4

我得到「這很可能會造成內存泄漏」錯誤。一旦我得到錯誤I,無法連接到activeMQ。我們已經注意到這個錯誤recently.Here是跟蹤:這很可能在tomcat 7.0.x中創建內存泄漏

27-Feb-2012 08:27:55 org.apache.catalina.loader.WebappClassLoader 
clearReferencesThreads 
SEVERE: The web application [/Webapp] appears to have started a 
thread named [Camel thread 1: ActiveMQComponent] but has failed to stop 
it. This is very likely to create a memory leak. 
27-Feb-2012 08:27:55 org.apache.catalina.loader.WebappClassLoader 
clearReferencesThreads 
SEVERE: The web application [/Webapp] appears to have started a 
thread named [Camel thread 2: ActiveMQComponent] but has failed to stop 
it. This is very likely to create a memory leak. 
27-Feb-2012 08:27:55 org.apache.catalina.loader.WebappClassLoader 
clearReferencesThreads 
SEVERE: The web application [/Webapp] appears to have started a 
thread named [ActiveMQ Scheduler] but has failed to stop it. This is very 
likely to create a memory leak. 
27-Feb-2012 08:27:55 org.apache.catalina.loader.WebappClassLoader 
clearReferencesThreads 
SEVERE: The web application [/Webapp] appears to have started a 
thread named [Camel thread 3: ProducerTemplate] but has failed to stop it. 
This is very likely to create a memory leak. 
27-Feb-2012 08:27:55 org.apache.catalina.loader.WebappClassLoader 
clearReferencesThreads 
SEVERE: The web application [/Webapp] appears to have started a 
thread named [Camel thread 4: ActiveMQComponent] but has failed to stop 
it. This is very likely to create a memory leak. 
27-Feb-2012 08:27:55 org.apache.catalina.loader.WebappClassLoader 
clearReferencesThreads 
SEVERE: The web application [/Webapp] appears to have started a 
thread named [Camel thread 5: ActiveMQComponent] but has failed to stop 
it. This is very likely to create a memory leak. 
27-Feb-2012 08:27:55 org.apache.catalina.loader.WebappClassLoader 
clearReferencesThreads 
SEVERE: The web application [/Webapp] appears to have started a 
thread named [Camel thread 6: ActiveMQComponent] but has failed to stop 
it. This is very likely to create a memory leak. 
27-Feb-2012 08:27:55 org.apache.catalina.loader.WebappClassLoader 
clearReferencesThreads 
SEVERE: The web application [/Webapp] appears to have started a 
thread named [Camel thread 7: ActiveMQComponent] but has failed to stop 
it. This is very likely to create a memory leak. 
27-Feb-2012 08:27:55 org.apache.catalina.loader.WebappClassLoader 
clearReferencesThreads 
SEVERE: The web application [/Webapp] appears to have started a 
thread named [Camel thread 8: ActiveMQComponent] but has failed to stop 
it. This is very likely to create a memory leak. 
27-Feb-2012 08:27:55 org.apache.catalina.loader.WebappClassLoader 
clearReferencesThreads 
SEVERE: The web application [/Webapp] appears to have started a 
thread named [Camel thread 9: ActiveMQComponent] but has failed to stop 
it. This is very likely to create a memory leak. 
27-Feb-2012 08:27:55 org.apache.catalina.loader.WebappClassLoader 
clearReferencesThreads 
SEVERE: The web application [/Webapp] appears to have started a 
thread named [Camel thread 10: ActiveMQComponent] but has failed to stop 
it. This is very likely to create a memory leak. 
27-Feb-2012 08:27:55 org.apache.catalina.loader.WebappClassLoader 
clearReferencesThreads 
SEVERE: The web application [/Webapp] appears to have started a 
thread named [Camel thread 11: ProducerTemplate] but has failed to stop 
it. This is very likely to create a memory leak. 
27-Feb-2012 08:27:55 org.apache.catalina.loader.WebappClassLoader 
clearReferencesThreads 
SEVERE: The web application [/Webapp] appears to have started a 
thread named [Camel thread 12: ProducerTemplate] but has failed to stop 
it. This is very likely to create a memory leak. 
27-Feb-2012 08:27:55 org.apache.catalina.loader.WebappClassLoader 
clearReferencesThreads 
SEVERE: The web application [/Webapp] appears to have started a 
thread named [Camel thread 13: ProducerTemplate] but has failed to stop 
it. This is very likely to create a memory leak. 
27-Feb-2012 08:27:55 org.apache.catalina.loader.WebappClassLoader 
clearReferencesThreads 
SEVERE: The web application [/Webapp] appears to have started a 
thread named [ActiveMQ Connection Worker: 
tcp://activeMQhost.localnet/192.168.0.15:61616] but has failed to stop it. 
This is very likely to create a memory leak. 

的Spring bean

<bean id="activemq" class="org.apache.activemq.camel.component.ActiveMQComponent">  
    <property name="brokerURL" value="${url}" /> 
</bean> 

$ {URL}設置爲

tcp://activeMQhost.localnet/192.168.0.15:61616?keepAlive=true&trace=true 

我想和ActiveMQ從連接一臺機器到另一臺機器。例如,運行在machine1上的Webapp和在activeMQhost上運行的activeMQ。有些時候,由於某種原因線程無法關閉。你可以找到在跟蹤中端的連接網址:

tcp://activeMQhost.localnet/192.168.0.15:61616 

回答

0

您可以考慮使用故障恢復交通,而不是...它甚至單個代理連接

http://activemq.apache.org/failover-transport-reference.html

+0

我們現在不能使用其他經紀人的網址。我只是想知道。此錯誤僅在3或4個小時後出現。你認爲,出於某種原因關閉連接? – ADS 2012-03-02 15:23:58

+0

什麼版本的AMQ?你在使用連接池嗎?故障轉移傳輸是要走的路... – 2012-03-02 16:27:31

+0

ActiveMQ-5.5.1最新版本。在我們使用舊版本之前。最近我們升級到最新的一個。 – ADS 2012-03-04 08:55:01

1

你更穩健可能想嘗試爲連接工廠bean指定destory-method(通常,這是針對ActiveMQ的「停止」,不確定駝峯版本)。

<bean id="..." class="..." destroy-method="stop"> 
    ... 
</bean>