OPC UA memory leak issue

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

Moderator: uasdkcpp

Post Reply
zheng chen
Jr. Member
Jr. Member
Posts: 4
Joined: 26 Jul 2018, 08:32

OPC UA memory leak issue

Post by zheng chen »

Hi team,

I am developing the OPC UA server with the 1.1 OPC UA stack. And I found that the server didn't release the occupied memory when the server is closed. The same problem exists with the 1.7.1 stack. I used the Valgrind to monitor the server's memory( 1.1 stack), I found that there is memory leak in the following functions.

==1721== 3,592 (136 direct, 3,456 indirect) bytes in 1 blocks are definitely lost in loss record 10,630 of 10,700
==1721== at 0x48470D8: operator new(unsigned int) (vg_replace_malloc.c:328)
==1721== by 0x635247F: UaObjectServer::createServerConfiguration(ServerConfig*) (uaobjectsserver.cpp:3449)
==1721== by 0x632ACC3: UaObjectServer::startUp(ServerConfig*, NodeManagerConfig*) (uaobjectsserver.cpp:310)
==1721== by 0x61DC5C7: NodeManagerRoot::afterStartUp() (nodemanagerroot.cpp:363)
==1721== by 0x61DB60B: NodeManagerRoot::startUp(ServerManager*) (nodemanagerroot.cpp:195)
==1721== by 0x62DC343: ServerManager::startUp(ServerConfig*) (servermanager.cpp:163)
==1721== by 0x61836E7: CoreModule::startUp(ServerConfig*) (coremodule.cpp:201)
==1721== by 0x63146F3: UaCoreServerApplication::start() (uacoreserverapplication.cpp:588)

Have you encountered such a problem before? How should I avoid this happening?

Thanks,
Zheng

zheng chen
Jr. Member
Jr. Member
Posts: 4
Joined: 26 Jul 2018, 08:32

Re: OPC UA memory leak issue

Post by zheng chen »

Hi team,

After the research, I found that the server will configure the configuration every time the server is started in the function: UaObjectServer::createServerConfiguration(ServerConfig* pServerConfig) line 3449 (uaobjectsserver.cpp). And m_pServerConfiguration will not be released after stopping the server. The stack that I used is version 1.1. Why does the m_pServerConfiguration will not be released after stopping the server?

Thanks

zheng chen
Jr. Member
Jr. Member
Posts: 4
Joined: 26 Jul 2018, 08:32

Re: OPC UA memory leak issue

Post by zheng chen »

Hi team, any update about my questions?

Post Reply