activemq-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael Feingold (JIRA)" <>
Subject [jira] [Commented] (AMQ-5762) Severe memory leak in the MQTT connector
Date Thu, 14 May 2015 20:00:59 GMT


Michael Feingold commented on AMQ-5762:

I believe I know what's going on. It looks like every time a connection to any topic is closed,
some memory is leaked. The amount of memory leaked is ~100b times number of currently existing
durable topics. Therefore if the number of durable topics is low, the leak us so slow you
can hardly see it. Also if connect/disconnect is happening only once in a blue moon - same
thing. In my use case both are pretty high, so here we are.

I captured a few memory dumps while I was running my tests and they show that every time a
connection is disconnected, for every durable topic there are 2 objects leaking - a hashmap
and a linkedlist Node. You  can clearly see it in the heapdump compare screenshot (attached
Here is what I did:

1. on a clean install I created 2 durable topics via console
2. created a heapdump1
3. I ran a test connecting to the same topic and immediately disconnecting from it. The connect/dosconnect
cyscle was repeated 50000 times.
4. another heapdump created

What you see in the picture is a comparison between the two. You can clearly see the 2 culprits.

> Severe memory leak in the MQTT connector
> ----------------------------------------
>                 Key: AMQ-5762
>                 URL:
>             Project: ActiveMQ
>          Issue Type: Bug
>          Components: MQTT
>    Affects Versions: 5.10.1, 5.10.2, 5.11.0, 5.11.1
>            Reporter: Michael Feingold
>            Assignee: Timothy Bish
>            Priority: Critical
>         Attachments: Screen Shot 2015-05-12 at 20.06.47.png, Screen Shot 2015-05-14 at
2.06.02 PM.png, activemq.xml, wrapper.conf
> When an MQTT connection is closed some memory is not released. In case of the soft close
(calling connection close on the client) memory leaks at the rate of 70K per connection close.
In case of the hard close (pulling the wire, or cutting off the network connection) the leak
goes at the rate of 300K per close. we also checked it on version 5.11 - same problem

This message was sent by Atlassian JIRA

View raw message