Page 1 of 1

OPC UA memory leak issue

Posted: 15 Nov 2019, 01:36
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

Re: OPC UA memory leak issue

Posted: 15 Nov 2019, 04:40
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

Re: OPC UA memory leak issue

Posted: 21 Nov 2019, 08:32
by zheng chen
Hi team, any update about my questions?