-
Notifications
You must be signed in to change notification settings - Fork 5
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
Memory leak in SendPacket.vi #4
Comments
That's a good observation. This has been put in place to handle QoS and I agree with you that it should skip it for QoS = 0. |
Yes I will start a new issue and explain how I measured the publish time. |
Memory LeakMemory leak will be fixed in the upcoming release. LatencyI just tested the following pathway, which is to publish a raw payload in QoS = 0: The payload used was 4 bytes, for a packet size of 15 bytes. With this simple setup, the client was dispatching the Publish packet to a session loop in ~48us. This is by no mean a perfect test because I am not knowledgeable about the inner workings of a TCP connection locally (does it implement the Nagle algorithm, for example?), but the point I was trying to test was that I didn't want to measure the connection latency. This is still much faster than the 1.4ms being reported. Of course, I used a small payload... Could it be that the serialization is very inefficient? I didn't use any serialization in my test. That does not mean there are no efficiency gains to be found! I'll be adding the VI into the repo. It's called "Test Publish QoS 0 Latency.vi" |
Fixed and released (3.1.5). Coming soon on VIPM Community. |
Thanks you for the update. Regarding the latency then I would just add that I also measured the time of the publish, and when I run my test on my PC I get comparable numbers. |
benchmarking can be followed in the new topic #7 |
Hi
In the search for a explanation for why it will take in average 1.4ms to publish to a topic I think I found a memory leak in the SendPackage.vi.
We only use QoS = 0 in this application because we need speed, and we can survive loosing packages. With my knowledge when sending a package with QoS = 0 the MQTT Broker will not replay with an ACK and here the problem starts, because every time we send a package the PackageID is stored in the PackageIDs DVR.
but is will not be taken off the PackageIDs array because no ACK is returned to the MQTT Client and therefore the array will keep growing.
One solution to this could be to use the Wait for ack? to not save the PacketID when we don't need to wait for a ACK.
But I'm not 100% sure that the PackageID is only used for verifying ACK if not then this is not the correct solution.
But I did not find a solution to why it takes in average 1.4ms to publish to a topic.
Regards
Kaare Juul Kirkegaard
The text was updated successfully, but these errors were encountered: