【问题标题】:This is very likely to create a memory leak in tomcat 7.0.x这很可能会在 tomcat 7.0.x 中造成内存泄漏
【发布时间】:2012-03-19 03:24:34
【问题描述】:

我不时收到“这很可能造成内存泄漏”错误。一旦我得到错误,我就无法连接到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 从一台机器连接到另一台机器。例如,在 ma​​chine1 上运行的 Webapp 和在 activeMQhost 上运行的 activeMQ。有时,由于某种原因,线程无法关闭。您可以在跟踪末尾找到连接 url:

tcp://activeMQhost.localnet/192.168.0.15:61616

【问题讨论】:

    标签: spring tomcat memory-leaks activemq


    【解决方案1】:

    您可能想尝试为您的连接工厂 bean 指定 destory-method(通常是 ActiveMQ 的“停止”,不确定骆驼版本)。

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

    【讨论】:

      【解决方案2】:

      您可以考虑改用故障转移传输...即使对于单个代理连接,它也更加强大

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

      【讨论】:

      • 我们现在不能使用另一个代理 url。我只是想知道。此错误仅在 3 或 4 小时后出现。你认为,连接因某种原因而关闭?
      • 什么版本的 AMQ?你在使用连接池吗?故障转移传输是要走的路...
      • ActiveMQ-5.5.1 最新版本。在我们使用旧版本之前。最近我们升级到最新版本。
      • 从春天开始,我只传递经纪人网址。 ' ' 这里 url = tcp ://activeMQhost.localnet/192.168.0.15:61616?keepAlive=true&trace=true
      猜你喜欢
      • 2011-07-14
      • 2013-03-15
      • 2013-01-29
      • 1970-01-01
      • 1970-01-01
      • 2012-02-09
      • 1970-01-01
      • 2012-04-09
      相关资源
      最近更新 更多