[jira] Created: (STOMP-10) stompconnect keeps (leaks) TcpTransport obects around forever

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

[jira] Created: (STOMP-10) stompconnect keeps (leaks) TcpTransport obects around forever

JIRA jira@codehaus.org
stompconnect keeps (leaks) TcpTransport obects around forever

                 Key: STOMP-10
                 URL: http://jira.codehaus.org/browse/STOMP-10
             Project: Stomp
          Issue Type: Bug
            Reporter: Bryan Talbot
            Priority: Critical
         Attachments: connleak.patch

The main loop in stompconnect's TcpTransportServer puts all TcpTransport objects into a collection and only removes them when stompconnect is shutdown.  One of these objects is leaked for every client connection.

it's not clear to me why these objects are kept around.  All elements of the connections collection is visited and closed on shutdown but otherwise there is no use of this private member.

In addition, the collection is a copy-on-write variant and the collection is constantly being written to and never read from.  A conventional (non java.util.concurrent) collection that handles frequent appends and removals would be more appropriate.

Attached is a patch that changes the connections type to LinkedList and attempts to remove all objects from the list for which isStopped() returns true.  The pruning operation is attempted on each iteration through the main loop.

If the collection really isn't needed, removing it completely would be an even better solution.

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira


To unsubscribe from this list, please visit: