2012-02-29 47 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>