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

Questions regarding the use of the C++ SDK for Server or Client development or integration into customer products ...

Moderator: uasdkcpp

Post Reply
SvenPC
Full Member
Full Member
Posts: 5
Joined: 22 Jul 2016, 12:46

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

Post 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

User avatar
Support Team
Hero Member
Hero Member
Posts: 2666
Joined: 18 Mar 2011, 15:09

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

Post 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
Best regards
Unified Automation Support Team

Post Reply