in our company we use unified automation to write data. In the program, sessions are first created, then each attached a subscription and then created a list of nodes, which is passed with
Code: Select all
Results = _Session.Write(NodesToWrite)
That's why I use .NETMemoryProfiler to find the cause. I noticed that every 45 minutes the LiveInstances and LiveBytes increase by a fixed amount. If I continue to follow the problem, I find that the UnifiedAutomation.UaBase.TcpChannel.WriteOperation has increased from 33 to 1144 within about three days. This is very much, because our software runs without shutdown for months / years.
The sessions and subscriptions have not changed their instance numbers, they have remained as they should. Now, as I follow a session, it has two instances of TcpChannel.WriteOperation, both contained in the Dictionary <uint, TcpChannel.WriteOperation>. This dictionary collects references to the instances of the WriteOperation and it grows tremendously over time. The write operations are quite common and usually two references are added to the Dictionary for each event and then removed, so it should be. But from time to time an additional reference comes to it and this probably just continues to exist, so that the dictionary grows from first
to5 of 7 slots in use
and more.105 of 197 slots in use
If I look at the instance details of the WriteOperation, I notice that in the case of the correctly executed operations on the FieldValues, m_timer has values, which supplies some variables, also m_cancelled. For the WriteOperation remaining in the dictionary, m_timer = null. Similarly, there are differences in the calling order.
Subscription leads to a similar dictionary, but there are no problems there.
Subscription leads to a similar dictionary, but there are no problems there.
Yours sincerely
Ottilie