Uploaded image for project: 'Qpid JMS'
  1. Qpid JMS
  2. QPIDJMS-438

details of remotely closed Sessions are not removed from the Connection



    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.39.0
    • 0.40.0
    • qpid-jms-client
    • None


      The Connection keeps track of its Sessions for housekeeping purposes, and previously these details have only been cleaned up fully if the Session close() method is called. If a Session is remotely closed, further attempts to use it and its resources will throw an exception as they are then marked closed. It is probable an application wont then call close() on the Session. If the application continues using the Connection in such a scenario, then the tracking details of the closed Session is retained thus leaking a small amount of memory, which if it is repeated a lot over time may eventually cause problems.

      The cleanup of this information should be moved into the Session shutdown process which occurs when it is locally or remotely closed.

      Original Description:

      We use Qpid JMS to connect to the Azure service bus.

      In our applications we cache the connections in a pool and cache a session for each connection for sending messages.

      When Azure believes the connection is idle for 5 minutes it is remotely closed. Resulting in closing the cached session in the application. The application responds by replacing the cached session with a newly created session.

      The problem here is that the closed sessions are not removed from the connection. Eventually resulting in an OutOfMemoryError.


        1. amqp.log
          21 kB
          David De Franco
        2. out-of-memory1.PNG
          312 kB
          David De Franco
        3. out-of-memory2.PNG
          574 kB
          David De Franco



            tabish Timothy A. Bish
            ddfranco David De Franco
            0 Vote for this issue
            3 Start watching this issue