-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
V1.3.13: Memory leak when call MQTTAsync_sendMessage with QOS0 #1429
Comments
In MQTTAsync_processCommand: |
Anyone who can help me on this issue? |
Did you set the onFailure callback as well as onSuccess? How long is your keepalive interval? When you pull the network cable out TCP stacks can respond in different ways, and take some time before the connection is recognized as broken. A shorter keep alive interval will allow this to happen more quickly - the connectionLost callback indicating it. You haven't said what OS you are using. |
Thanks for your reply! My application scenario is as follows: client -> broker -> server. I did the above test with network cable disconnected. Thanks! |
What is the status of this issue? |
Hello, valgrind just found these memory leaks inside paho (v1.3.10) :
@icraggs Do you believe, this could be the same issue as above? |
????????(??)??????????????????????????????????????????????????????????? !?????????????????????:http://ulaej.cn
|
After looking deeper into it: This is related to receive, probably fixed by merge request #1487 |
I don't know if they are common without getting some further information. |
So, at least part of this is related to #1474 |
????????(??)??????????????????????????????????????????????????????????? !?????????????????????:http://ulaej.cn
|
The changes I've put in for #1474 appear to have fixed this too. |
Description:
Memory leak when call MQTTAsync_sendMessage with QOS0
Reproduce:
4.1 MQTTAsync_sendMessage 16K data, then return send OK, but onSendSuccess callback didn't be called.
Usually the payload will be free automatically after onSendSuccess be called.
But I didn't get this be called.
I think the leak was cause by MQTTASYNC_OPERATION_INCOMPLETE.
Log:
onSendFailure 128: Message send failed token 0 error code -11, --> MQTTASYNC_OPERATION_INCOMPLETE
onSendFailure 133: Failed to start disconnect, return code -3, Disconnected
onSendFailure 128: Message send failed token 0 error code -11,
onSendFailure 133: Failed to start disconnect, return code -3, Disconnected
trace_callback 214: Trace : 5, 20231205 162437.367 Some memory not freed at shutdown, possible memory leak
trace_callback 214: Trace : 5, 20231205 162437.367 Heap scan start, total 1584304 bytes
trace_callback 214: Trace : 5, 20231205 162437.367 Heap element size 48, line 1108, file ../xxx/lib/paho.mqtt.c/MQTTProtocolClient.c, ptr 0x28b468
trace_callback 214: Trace : 5, 20231205 162437.367 Content 111/O
trace_callback 214: Trace : 5, 20231205 162437.367 Heap element size 48, line 1108, file ../xxx/lib/paho.mqtt.c/MQTTProtocolClient.c, ptr 0x298740
trace_callback 214: Trace : 5, 20231205 162437.367 Content 111/O
trace_callback 214: Trace : 5, 20231205 162437.367 Heap element size 72624, line 1277, file ../xxx/lib/paho.mqtt.c/MQTTAsync.c, ptr 0x3fc6b0
trace_callback 214: Trace : 5, 20231205 162437.367 Content {"Md5Code"
trace_callback 214: Trace : 5, 20231205 162437.367 Heap element size 90336, line 1277, file ../xxx/lib/paho.mqtt.c/MQTTAsync.c, ptr 0x4390a8
trace_callback 214: Trace : 5, 20231205 162437.367 Content {"Id":0,"P
trace_callback 214: Trace : 5, 20231205 162437.367 Heap element size 16, line 92, file ../xxx/lib/paho.mqtt.c/LinkedList.c, ptr 0xb4600598
trace_callback 214: Trace : 5, 20231205 162437.367 Content
trace_callback 214: Trace : 5, 20231205 162437.367 Heap element size 32, line 264, file ../xxx/lib/paho.mqtt.c/MQTTProtocolClient.c, ptr 0xb4600a68
trace_callback 214: Trace : 5, 20231205 162437.367 Content p?(
trace_callback 214: Trace : 5, 20231205 162437.367 Heap element size 16, line 92, file ../xxx/lib/paho.mqtt.c/LinkedList.c, ptr 0xb4600e30
trace_callback 214: Trace : 5, 20231205 162437.367 Content
trace_callback 214: Trace : 5, 20231205 162437.367 Heap element size 16, line 116, file ../xxx/lib/paho.mqtt.c/MQTTProtocolClient.c, ptr 0xb4601678
trace_callback 214: Trace : 5, 20231205 162437.367 Content
The text was updated successfully, but these errors were encountered: