Hi all, 

I am using a slightly modified version of QPID to communicate with Microsoft
Azure IoT Hub called proton-j-azure-iot-0.12.2.

So straight to the problem. I am investigating a memory leak when using a
HandlerThread class to post a task.

Here is the rough code snippet :



I've been reading a lot lately about Handler Thread so the structure above
was chosen because it takes care of Looper management.

So after running for 24 hours, the heap dump is run through Eclipse Memory
Analyzer and it suggests that the memory leak suspect is a lot of Thread not
being garbage collected. The heap increases 3MB after running roughly 16
hours. 

<http://qpid.2158936.n2.nabble.com/file/n7648353/thread.png> 
<http://qpid.2158936.n2.nabble.com/file/n7648353/suspect.png> 

It seems to me that the HandlerThread class implementation is correct (I
follow this:
https://blog.nikitaog.me/2014/10/11/android-looper-handler-handlerthread-i/
). And just by looking at the Dominator tree in MAT, it is not obvious where
the problem can be. 

I've been pulling my hair out and searching through StackOverflow on memory
leak problem regarding THread operation but haven't found any concrete
solution to this.

Has anybody come across this before or How can I find out where the problem
is given all the tools that I have (Android studio and MAT)?

Any help appreciated.
Many thanks for reading



--
View this message in context: 
http://qpid.2158936.n2.nabble.com/JAVA-Android-Memory-Leak-Investigation-tp7648353.html
Sent from the Apache Qpid users mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@qpid.apache.org
For additional commands, e-mail: users-h...@qpid.apache.org

Reply via email to