You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by "Kevin Yaussy (JIRA)" <ji...@apache.org> on 2007/04/16 17:41:34 UTC

[jira] Commented: (AMQ-1202) 4.2 Broker memory leak wrt network connectors

    [ https://issues.apache.org/activemq/browse/AMQ-1202?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_39013 ] 

Kevin Yaussy commented on AMQ-1202:
-----------------------------------

This is kind of an ugly one, but I traced it down to org/apache/activemq/broker/TransportConnector.java and its usage of the connections list.  The code pathway for setting up a Network connection goes as far as calling TransportConnector.onStarted, which adds to this list.  However, this path gets called prior to discovering that the target is not there, but TransportConnector.onStopped is never called.  Thus, TransportConnection objects are leaked into the connections list.

I did not discover yet what use this list is, other than potentially on Broker shutdown, if TransportConnector.stop is called.  So, as a quick work around, I've commented out usage of the connections list in TransportConnector.onStarted and onStopped.

> 4.2 Broker memory leak wrt network connectors
> ---------------------------------------------
>
>                 Key: AMQ-1202
>                 URL: https://issues.apache.org/activemq/browse/AMQ-1202
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: Broker
>    Affects Versions: 4.2.0
>            Reporter: Kevin Yaussy
>             Fix For: 4.2.0
>
>         Attachments: jmap.tar
>
>
> If the NetworkConnector list contains any entries to unavailable / unreachable targets, memory is leaked.
> Tested with a broker having fairly "stock" settings, and with the following NetworkConnector section:
>     <networkConnectors>
>       <networkConnector uri="static://(tcp://dummy:5111?connectionTimeout=5000)" prefetchSize="10000"/>
>     </networkConnectors>
> I am using JDK 1.6, since that version of jmap allows the "-histo:live" switch, producing a list of the live objects.
> Just after starting the Broker, here is the top 10 entries from jmap:
> num   #instances    #bytes  class name
> --------------------------------------
>   1:     36639     4143792  <constMethodKlass>
>   2:     36639     2935200  <methodKlass>
>   3:     54423     2326752  <symbolKlass>
>   4:      8099     2008984  [B
>   5:      3451     1771816  <constantPoolKlass>
>   6:      3451     1433032  <instanceKlassKlass>
>   7:     14220     1212160  [C
>   8:      2894     1089840  <constantPoolCacheKlass>
>   9:         8      524352  [Lorg.apache.activemq.command.DataStructure;
> And then after about 5 minutes or so, here's the jmap top 10:
> num   #instances    #bytes  class name
> --------------------------------------
>   1:       198    12977712  [Lorg.apache.activemq.command.DataStructure;
>   2:     36647     4144520  <constMethodKlass>
>   3:     36647     2935840  <methodKlass>
>   4:     54427     2326960  <symbolKlass>
>   5:      8293     2207032  [B
>   6:      3455     1773488  <constantPoolKlass>
>   7:      3455     1434376  <instanceKlassKlass>
>   8:     14499     1234040  [C
>   9:      2898     1091120  <constantPoolCacheKlass>
>  10:     17754      426096  java.lang.String
> Not sure what component down the list is holding onto DataStructure, but I've included the full jmap output files.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.