[ 
https://issues.apache.org/jira/browse/AMQ-4889?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13839065#comment-13839065
 ] 

matteo rulli commented on AMQ-4889:
-----------------------------------

Actually, swapping the start method and the connections.add() in 
setAcceptListener method in ProxyConnector turned out not to be a good idea. 
The _connections.remove()_ in TransportFilter.stop may be called before the 
connections.add() is invoked.
I appreciate this in the form of a tiny yet continous memory leakeage due to 
objects accumulating in connections collection.

Therefore I modified again the ProxyConnector code to fix also this sort of 
race condition: now I invoke the connections.add() _before_ invoking the start 
but I manage the removal inside a try-catch block (see the updated 
ProxyConnector_patch_AMQ_4889.txt patch)

Besides, I had to modify the equals method in ProxyConnection to avoid NPE in 
case local or remote transorts are null. I updated the 
ProxyConnection_patch_AMQ_4889.txt file with this fix.
I'm not completely satisfied with this ProxyConnection.equals() method, since 
it seems a little bit awkward to me. I don't know, maybe you can suggest a 
better strategy to purge the connections list.


> ProxyConnector memory usage skyrockets when several ssl handshakes fails
> ------------------------------------------------------------------------
>
>                 Key: AMQ-4889
>                 URL: https://issues.apache.org/jira/browse/AMQ-4889
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Broker
>    Affects Versions: 5.8.0, 5.9.0
>         Environment: Seen in Windows 7 64bit, Windows Server 2008 R2 and 
> Linux RHEL 6.3 64 bit
>            Reporter: matteo rulli
>            Assignee: Timothy Bish
>         Attachments: AMQ4889.patch, NIOSSLTransport_patch_AMQ_4889.txt, 
> ProxyConnIssue.rar, ProxyConnection_patch_AMQ_4889.txt, 
> ProxyConnector_patch_AMQ_4889.txt, after_lsof.txt, after_netstat.txt, 
> lsof.txt, netstat.txt, sockstat.txt
>
>
> See 
> [nabble|http://activemq.2283324.n4.nabble.com/Proxy-Connector-memory-consumption-td4674255.html]
>  for further details.
> To reproduce the issue:
> # Start embedded proxy broker and the AMQ broker that are embedded in 
> *AMQTestBroker* project (see attachments);
> # Start the *AMQTestConsumer* project; This program repeatedly tries opening 
> a connection to the ProxyConnector with wrong certificates.
> # Open jconsole to monitor AMQTestBroker memory usage: you should experience 
> an OOM error within one hour with the suggested settings (Xmx = 2048m).
> Launch configurations and test keystores are attached to this issue along 
> with the java projects.
> This behavior seems to affect _ProxyConnector_ only, running the test against 
> a standard nio-based _TransportConnector_ does not seem to produce anomalous 
> memory consumptions.



--
This message was sent by Atlassian JIRA
(v6.1#6144)

Reply via email to