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:
    
      com.ibm.mq.MQQueueManager
    
    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
    object:
    
    com.ibm.mq.jmqi.remote.impl.RemoteSession
    
    
    The number of these objects seen in the heapdump is similar to
    the number of times the "com.ibm.mq.MQQueueManager" 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

  • ****************************************************************
    USERS AFFECTED:
    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:
    MultiPlatform
    
    ****************************************************************
    PROBLEM DESCRIPTION:
    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:
    
      MQDISC
    
    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:
    
      com.ibm.mq.jmqi.remote.impl.RemoteSession
      com.ibm.mq.jmqi.remote.api.RemoteHconn
    

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   9.0.0.6
    v9.1 CD    9.1.2
    v9.1 LTS   9.1.0.2
    
    The latest available maintenance can be obtained from
    'WebSphere MQ Recommended Fixes'
    http://www-1.ibm.com/support/docview.wss?rs=171&uid=swg27006037
    
    If the maintenance level is not yet available information on
    its planned availability can be found in 'WebSphere MQ
    Planned Maintenance Release Dates'
    http://www-1.ibm.com/support/docview.wss?rs=171&uid=swg27006309
    ---------------------------------------------------------------
    

Temporary fix

Comments

APAR Information

  • APAR number

    IT26789

  • Reported component name

    IBM MQ BASE M/P

  • Reported component ID

    5724H7261

  • Reported release

    900

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt / Xsystem

  • Submitted date

    2018-10-29

  • Closed date

    2018-11-09

  • Last modified date

    2018-11-09

  • 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

    IBM MQ BASE M/P

  • Fixed component ID

    5724H7261

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":"LOB36","label":"IBM Automation"}}]

Document Information

Modified date:
09 November 2018