Java IBM MQ |内存泄漏|堆转储

Java IBM MQ |内存泄漏|堆转储,java,memory-leaks,websphere,ibm-mq,heap-dump,Java,Memory Leaks,Websphere,Ibm Mq,Heap Dump,websphere版本-8.5.5.17 unzip -p com.ibm.mq.jar META-INF/MANIFEST.MF|grep Implementation-Version // Not Output unzip -p com.ibm.mqbind.jar META-INF/MANIFEST.MF|grep Implementation-Version // Not Output unzip -p com.ibm.mq.jmqi.jar META-INF/MANIFEST.MF

websphere版本-8.5.5.17

unzip -p com.ibm.mq.jar META-INF/MANIFEST.MF|grep Implementation-Version
// Not Output

unzip -p com.ibm.mqbind.jar META-INF/MANIFEST.MF|grep Implementation-Version
// Not Output

unzip -p com.ibm.mq.jmqi.jar META-INF/MANIFEST.MF|grep Implementation-Version
Implementation-Version: 7.0.1.4 - k701-104-110104
com.ibm.mq.jar - Manifest-Version: 1.0

com.ibm.mq.jmqi.jar - Manifest-Version: 1.0
Ant-Version: Apache Ant 1.7.0
Created-By: 1.4.2 (IBM Corporation)

com.ibm.mqbind.jar -  Manifest-Version: 1.0

Java 1.8
我们正在使用MQ发送数据。应用程序已运行多年,每天都会重新启动服务器。现在,我们希望将每天的堆/内存错误减少到每周,但我们已经开始出现堆/内存错误

在生成堆转储并进行分析时,我们发现了以下问题

Leak suspect    12,338,040 bytes (11.62 %) of Java heap is used by 106 instances of com/ibm/rmm/transmitter/QueueT
Total size  12,338,040 bytes
Size    424 bytes
Name    array of com/ibm/rmm/transmitter/Submitter
Number of children  106
Number of parents   1
Owner address   0xc1b423b8
Owner object    com/ibm/ws/dcs/vri/transportAdapter/rmmImpl/rmmGroup/RmmPtpGroup
Address 0xc645af70
First single ancestor   com/ibm/ws/dcs/vri/transportAdapter/rmmImpl/rmmGroup/RmmPtpGroup at 0xc645af70




Leak suspect    27,580,544 bytes (27.54 %) of Java heap is used by 7 instances of java/util/HashMap$Node
Contains an instance) of the leak suspect:
- array of com/ibm/rmm/transmitter/Submitter holding 11,990,072 bytes at 0xc53e9730
Total size  27,580,544 bytes
Size    64 bytes
Name    array of java/util/HashMap$Node
Number of children  7
Number of parents   1
Owner address   0xc2b6bbf0
Owner object    java/util/HashMap
Address 0xc2b6bc18
First single ancestor   sun/nio/ch/EPollSelectorImpl at 0xc2b6bc18
在较高的层次上,我可以在下面的finally块中调用的代码中看到

MQQueue -> close()
MQQueueManager -> disconnect()
不确定是否需要在代码中进行某些更改来清理资源,或者是否需要更新某些库版本或websphere

我在评论部分升级了上述客户端库,并得到以下错误

Caused by: java.lang.NoSuchMethodError: com/ibm/mq/jmqi/JmqiMQ.isLocal()Z (loaded from file:/opt/middleware/availments/WebSphere/85-64/installedConnectors/wmq.jmsra.rar/com.ibm.mq.jmqi.jar by org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader@bf93861d) called from class com.ibm.mq.ese.jmqi.ESEJMQI
我与MQ支持部门就这个问题进行了核实

在WAS中运行时,不能使用已安装的MQ客户端。您必须使用MQ资源适配器。 根据以下链接:


为了使用MQ 9.1 MQ RA,必须运行支持JMS 2.0的WAS版本。WAS7、8AD8.5仅支持JMS1.1。因此,为了让您能够使用MQ RA 9.1,您需要将WAS升级到9.0.5。

@JoshMc添加了requiredversions@JoshMc更新的问题回答你的。我只在1JAR中看到了实现版本,对于rest来说,manifest file7.0中的任何内容都没有在5年之内的5天内失去支持。WAS8.5本身带有来自7.1 MQ版本的资源适配器,该版本在绑定之外不受支持。我建议您尝试9.1.0.6或9.2.0.0中的单个com.ibm.mq.allclient.jar。@谢谢,我会尝试,当前的websphere版本8.5.5.17
com.ibm.mq.allclient.jar需要您提到的Java 8,所以它应该可以工作。我还知道,例如,MQ v5.2 java客户端仍然可以连接到MQ v9.1队列管理器。IBM有时试图保持这种兼容性,但代价是将20年前的东西保留在今天不再有意义的地方。