【发布时间】:2017-06-23 19:32:12
【问题描述】:
我的 ActiveMQ 堆大小不断增加,最终内存不足。为一个仍在运行的实例获取堆转储,并得到以下具有大量实例的类(其余类非常少)。寻找有关此处可能出现问题的指示。
170866 instances of class org.apache.activemq.command.ProducerId
170526 instances of class org.apache.activemq.broker.jmx.AnnotatedMBean
170519 instances of class org.apache.activemq.command.SessionId
170518 instances of class org.apache.activemq.command.ConnectionId
170482 instances of class org.apache.activemq.broker.ProducerBrokerExchange
170482 instances of class org.apache.activemq.broker.jmx.ProducerView
170482 instances of class org.apache.activemq.command.ProducerInfo
170482 instances of class org.apache.activemq.state.ProducerState
发送消息的代码 sn-p:
MessageProducer messageProducer = session.createProducer(topic);
messageProducer.setTimeToLive(5 * 60 * 1000);
Message message = session.createObjectMessage(agentDebugEvent);
messageProducer.send(message);
是不是因为messageProducer.close()不见了?
【问题讨论】:
标签: java memory-leaks activemq