IBM Support

IT26789: MQ Classes for Java memory leak when communicating to the queue manager over an unreliable TCP/IP network

Subscribe to this APAR

By subscribing, you receive periodic emails alerting you to the status of the APAR, along with a link to the fix after it becomes available. You can track this item individually or track all items by product.

Notify me when this APAR changes.

Notify me when an APAR for this component changes.


APAR status

  • Closed as program error.

Error description

  • A MQ Classes for Java application is being used to communicate
    with a queue manager.  The TCP/IP network connection to the
    queue manager is unreliable, resulting in the:
    object instance being regularly disconnected from the queue
    manager, after which the application creates a new object to
    replace the disconnected object instance.
    After a period of time, a Java heapdump is collected and
    analysed, and is found to contain numerous references to the
    The number of these objects seen in the heapdump is similar to
    the number of times the "" was
    disconnected to the queue manager.
    Regardless of the amount of time the JVM is left running for,
    these objects are not cleared up.

Local fix

Problem summary

  • ****************************************************************
    This issue affects use of the IBM MQ classes for Java and JMS,
    who are connecting to the queue manager using the "CLIENT"
    transport (that is to say connecting over a network), and
    experiencing frequent network disconnection events between the
    application and the queue manager.
    Platforms affected:
    A "java.util.concurrent.ConcurrentHashMap" is used by the MQ
    classes for Java/JMS, to track all active connections between
    the application and the queue manager.
    It was intended that these connections would be removed from the
    "java.util.concurrent.ConcurrentHashMap" after the MQ API flow:
    was flowed to the queue manager.
    However - if the TCP/IP connection had been disconnected between
    the JVM and the queue manager host system, then internally
    within the MQ classes for Java/JMS, this MQDISC flow would throw
    an exception to report the broken connection.
    When this happened, the code to remove the entry from the
    HashMap was skipped, which meant that a reference to several
    objects associated with the connection was left in memory -
    preventing the garbage collector from removing them.
    While the amount of memory used by these objects was relatively
    small, if using a very unreliable network, then over time this
    could build up to consume a significant amount of the JVM's
    heap, which in turn could ultimately lead to a
    "java.lang.OutOfMemoryError" exception being thrown.
    The main Java objects observed in a Java heap dump associated
    with this issue were:

Problem conclusion

  • The MQ classes for Java/JMS have been updated to ensure that the
    entries in the "java.util.concurrent.ConcurrentHashMap" are
    removed when the MQDISC flow is attempted, even if it should
    fail due to a disconnected connection.
    The fix is targeted for delivery in the following PTFs:
    Version    Maintenance Level
    v9.0 LTS
    v9.1 CD    9.1.2
    v9.1 LTS
    The latest available maintenance can be obtained from
    'WebSphere MQ Recommended Fixes'
    If the maintenance level is not yet available information on
    its planned availability can be found in 'WebSphere MQ
    Planned Maintenance Release Dates'

Temporary fix


APAR Information

  • APAR number


  • Reported component name


  • Reported component ID


  • Reported release


  • Status


  • PE




  • Special Attention

    NoSpecatt / Xsystem

  • Submitted date


  • Closed date


  • Last modified date


  • APAR is sysrouted FROM one or more of the following:

  • APAR is sysrouted TO one or more of the following:

Fix information

  • Fixed component name


  • Fixed component ID


Applicable component levels

[{"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Product":{"code":"SSYHRD","label":"IBM MQ"},"Component":"","ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"9.0","Edition":"","Line of Business":{"code":"LOB45","label":"Automation"}}]

Document Information

Modified date:
09 November 2018