Memory not freed when loosing connection

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

Moderator: uasdkc

Post Reply
abramow
Jr. Member
Jr. Member
Posts: 1
Joined: 19 Jan 2021, 16:30

Memory not freed when loosing connection

Post by abramow »

Hi,

we see a rise of memory consumption when using a OPC UA server in the following scenario (using ANSI C SDK 1.6).
At least one client (e.g. UAexpert) is subscribed to an event, settings for e.g publishingInterval, LifetimeCount are default.
The events are seen in UAexpert.
If cutting the connection between client and server and reconnecting again within the publishingInterval * LifetimeCount. The events are then published to the subscriber (UAExpert). Our events contain payload, so the memory consumption rises while the connection is broken. But after reconnection the memory is not freed.
The same memory consumption is seen if the time is longer the difference is of course that the subscription is deleted.
The amount of used memory is dependent on the number of buffered events and the payload of each event.

Has someone seen such a memory leak in this scenario?

Could be the clearing of the list a possible reason?
In the code of the subscription_manager I found that the list lstSubscriptionsToPublish is cleared after every publishingintervall.
The comment on OpcUa_ListElement_Clear states "The user data is not deleted! This has to be done by the user."

Any ideas are welcome.

Thanks,

abramow

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

Re: Memory not freed when loosing connection

Post by Support Team »

Hello,
The comment on OpcUa_ListElement_Clear states "The user data is not deleted! This has to be done by the user."
The user, is the user of the SDK, which is YOU.

BTW: the v1.6 has reached end of life and is not supported anymore, we recomend to use latest version of the SDK. However, even in latest SDK you must clear memory yourself when being stated to do so in the comment of the function you use.
Best regards
Unified Automation Support Team

Post Reply