Hell, everyone, is there any method to know the size of RefreshMsg or UpdateMsg object ?
Currently in onRefreshMsg & onUpdateMsg, I will create a new object using new operator and push back into an internal queue that has no size limit that will be popped by a decoder thread for processing. But on market open time, the queue will soon filled with many messages and consumes much memory with 1 minute due to speed unmatch between callback thread and decoder thread. Even though 1 minutes later, the decoder consumes message in the queue, the memory of deleted message will still reside in the application, unable to be released to operating system.
One method is to increase decoder thread. But my puzzle is If i increase decoder thread count, due to message wil be hashed into queue via ric, but different ric may comes with different message count, which may cause certain queue filled with messages faster than corresponding decoder can process.
So how should I resolve this problem ?