OPCFoundation / UA-.NET-Legacy

OPC Foundation Unified Architecture .NET Reference Implementations
330 stars 298 forks source link

Mantis 3093 & 3094 - Handle accumulation on monitored items #135

Open Alex6092 opened 7 years ago

Alex6092 commented 7 years ago

Using one lock object per monitored item causes the system to use one handle per monitored items when a simultaned access is done to the lock object, we propose the following modification in the file SampleApplications/SampleLibraries/Server/Subscription/MonitoredItem.cs, line around 1850 :

                // Replace the lock per monitored item by a static lock (1 for all) :
                // private object m_lock = new object();
        static private object m_lock = new object();

This modification avoids the impression of handle leaks caused by many monitored items during endurance testing.