这很可能在tomcat 7.0.x中创建内存泄漏

时间:2012-02-29 16:07:59

标签: spring tomcat memory-leaks activemq

我得到“这很可能会造成内存泄漏”的错误。一旦我收到错误I,就无法连接activeMQ。我们最近注意到了这个错误。这是跟踪:

    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.

春豆

<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 上运行的Web应用程序和在 activeMQhost 上运行的activeMQ。有时,线程因某些原因无法关闭。您可以在跟踪的末尾找到连接URL:

tcp://activeMQhost.localnet/192.168.0.15:61616

2 个答案:

答案 0 :(得分:1)

您可能想尝试为连接工厂bean指定destory-method(对于ActiveMQ,通常是'stop',不确定驼峰版本。)

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

答案 1 :(得分:0)

您可能会考虑使用故障转移传输...即使对于单个代理连接也更加健壮

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

相关问题