首页 > 解决方案 > IBM MQ | 内存泄漏 | 堆转储

问题描述

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 资源适配器。根据以下链接: https ://www.ibm.com/support/knowledgecenter/en/SSFKSJ_8.0.0/com.ibm.mq.dev.doc/q031610_.htm

为了让您使用 MQ 9.1 MQ RA,您必须运行支持 JMS 2.0 的 WAS 版本。WAS 7、8 和 8.5 仅支持 JMS 1.1。因此,为了让您能够使用 MQ RA 9.1,您需要将 WAS 升级到 9.0.5。

标签: javamemory-leakswebsphereibm-mqheap-dump

解决方案


推荐阅读