We are seeing a memory leak on SLProtocol and I think it is related to the amount of data that comes from a device.
The connection is a web socket connection and the element is receiving messages so quick that the messages are stacking up in SLProtocol's queue because they are not process as fast. I see many of the following message on the element log file:
021/10/25 16:37:32.938|SLProtocol - 23368 - TWLER101-1917-IPG03|17752|CProtocol::SmartIPReadThreadFunc|DBG|-1|Still 4000 messages to process.
What is the meaning of this log message?
Is there a way to see the items that are waiting to execute in the SLProtocol Queue?
Hi Miguel,
The SmartIPReadThread is a thread running in SLProtocol used to process smart-serial responses. These responses are processed sequentially and the next one will only be processed when the previous one has been fully handled.
Are you triggering a QAction to process/parse these responses? You might want to look into how quickly responses are coming in compared to the time it takes to process them.
If the rate is too high, then a solution would be better to buffer the responses and process/offload them in bulk every x seconds (using a timer for example). This will make sure that your QAction finishes as soon as possible everytime a new request comes in. You could even do the processing in a different thread then.
Joey, I am parsing using a QAction. I used the Pending Calls on test tool and noticed that the QAction was sometimes running for 2-3 seconds. The frequency in which the device is sending data was set to 1 second. Changing the frequency to 4 seconds fixed the issue. I will advice the user about the method you recommended to avoid issues later on. Thanks!