Dashboard-OPCUA-Client icon indicating copy to clipboard operation
Dashboard-OPCUA-Client copied to clipboard

Memory Leak/ Magic number in buildCustomDataTypes

Open ccvca opened this issue 2 years ago • 3 comments

This memory seems to be never freed. Also this 50 looks random. https://github.com/umati/Dashboard-OPCUA-Client/blob/96071ba3a050bb78709eda4280465edb3de69cd1/OpcUaClient/OpcUaClient.cpp#L144

==24634== 1,000 bytes in 1 blocks are definitely lost in loss record 631 of 646
==24634==    at 0x483950F: operator new[](unsigned long) (vg_replace_malloc.c:431)
==24634==    by 0x7C792A: Umati::OpcUa::OpcUaClient::readTypeDictionaries() (OpcUaClient.cpp:275)
==24634==    by 0x173904: main (TestResultType.cpp:21)
==24634== 
==24634== 1,600 bytes in 1 blocks are definitely lost in loss record 635 of 646
==24634==    at 0x483877F: malloc (vg_replace_malloc.c:307)
==24634==    by 0x7C60C4: Umati::OpcUa::OpcUaClient::buildCustomDataTypes() (OpcUaClient.cpp:144)
==24634==    by 0x173913: main (TestResultType.cpp:22)
==24634== 
==24634== 2,720 (32 direct, 2,688 indirect) bytes in 1 blocks are definitely lost in loss record 641 of 646
==24634==    at 0x4838DEF: operator new(unsigned long) (vg_replace_malloc.c:342)
==24634==    by 0x7C7574: Umati::OpcUa::OpcUaClient::buildCustomDataTypes() (OpcUaClient.cpp:267)
==24634==    by 0x173913: main (TestResultType.cpp:22)

PS: TestResultType is just a minimal application for debugging.

ccvca avatar Jul 21 '23 06:07 ccvca

@ccvca Do you create an new Branch?

Kantiran91 avatar Jul 21 '23 09:07 Kantiran91

No, it's just some local isolated testing.

ccvca avatar Jul 21 '23 09:07 ccvca

https://github.com/umati/Dashboard-OPCUA-Client/pull/new/debug_IjtResultType This is my test script https://github.com/umati/Dashboard-OPCUA-Client/blob/e79574a08fe7c4f9bd9e0ffa15563984991da942/TestResultType.cpp

ccvca avatar Jul 21 '23 12:07 ccvca