-
Notifications
You must be signed in to change notification settings - Fork 97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
is the tokenmap can not release #679
Comments
It's a left over from Eclipse project https:/eclipse/paho.mqtt.android/blob/a6496553bd07886bb1608e6e3aa739c38f26700a/org.eclipse.paho.android.service/src/main/java/org/eclipse/paho/android/service/MqttAndroidClient.java#L136-L138 If you have a better idea, please make a pull request |
This is a minor improvement #680 |
But the main question is still there: Why they handle token by |
can you merged into branch v3.x ? and is it resolve the memory problem? i can see u are only change SparseArray to MutableList. |
i was use qos 0 |
@baneyue When your test is successful, I will merge it into |
I found this problem. When I use the master branch, I won't have this issue, but when I use 3. x, I have this problem. This should be caused by broadcastReceiver, because my usage scenario is sending a string of data in 1 second. so i think need not to replace SparseArray to List。 you can merge the flow to 3.x branch to replace the BroadcastReceiver |
I'm somehow lost here The pull request solves nothing, but I should merge it? -no- Master comes with another issue, means a lost receiver? But 3.x us fine? It's another blueprint that I only should merge existing pull requests and anything else is a waste of time. Right? |
Wait, I'm still testing |
@hannesa2 this problem may be the qos =0 and when send failure,it will not callback deliveryComplete |
Nice. The causing issue is a resulting non-remove of these in popSendDetails ? Am I right ?
|
yes, there have two leak place : `
` ` private val tokenMap = SparseArray<IMqttToken?>() ` |
otherwise
|
This all comes with uncertain actions, so it's worth to have a test for it in advance and surveil the memory usage in this test. Any ideas how to do so ? |
u can publish a message set qos =0, and u device is low network style, run your app long time. My current plan is to set qos=0 without caching, so there will be no callbacks; A better approach would be to specify a timeout period, after which the token will be removed if there is no callback. |
As far as I understand, you run into this with a lot of publishes qos =0,, which all run into (network?) errors. Am I right ? |
The network is weak or congested, and there has been no disconnection Actually, I'm not sure what the root cause is, but after running for a long time, some callbacks cannot be received, causing those caches to be unable to be released, and the memory growth is not fast. Through profile analysis, the object continues to grow, which is quite observable for our low-end devices, causing the application to slow down |
It's not a miracle, when you do a lot on low end device, that it will become slow. |
What is the reason for the continuous increase in objects in the tokenMap during long-term application operation. Running 12 will take up a lot of memory
The text was updated successfully, but these errors were encountered: