Page 1 of 1

Possibly memory leak in OPCUA SDK when using huge DA subriptions with queue size > 1

Posted: 03 Jun 2021, 13:32
by SvenPC
Environment
Using OPCUA SDK C++ V1.7.4 Build 520 and vxworks V7 SR660.
But same issue with OPCUA SDK C++ V1.5.6 Build 361 on vxworks 7 SR620 or vxworks 6.9.4.11.

Description of the issue
OPCUA Server with 16851 nodes.
When the client (using OPCUA SDK C++ or C#) request all nodes as monitored items and using the following parameters
  • PublishingInterval = 100 [ms]
  • SamplingInterval = 100 [ms]
  • QueueSize=100
it takes only some seconds that no more memory is left on targets site.

Some background
Our OPCUA server has it's own memory subsystem with its own limits.
Therefore we are sure that the SDK has requested the memory.
When we increase the limits it needs some seconds more that limit is reached.
All is fine when setting QueueSize to 1. After hours there is no loss of memory.
But in some cases we need a higher queueSize (= 100).

The questions are
  • Do we have an configuration/programming error here?
  • Could it be an issue for possible denail of service attacks?
  • Is there any known fix to solve this issue?
Thanks
Sven

Re: Possibly memory leak in OPCUA SDK when using huge DA subriptions with queue size > 1

Posted: 19 Jul 2021, 21:16
by Support Team
Hello SvenPC,

when the MonitoredItems are created the SDK allocates memory for the MonitoredItemItemQueues.
If QueueSize is set to 100 you get 100 * 16851 allocations in your example.
So yes - this probably is a configuration issue. You can't allow to create more MonitoredItems / Queues than the platform can provide memory for.
You should configure the maximum for testing and use those values as limit in the ServerConfig.

see also: http://documentation.unified-automation.com/uasdkcpp/1.7.4/html/L2ServerSdkServerConfig.html#server_config_xml_file_serversettings