Hi libodbc++ team,
We are using libodbc++ on huge load application and facing memory leak on each connection creation with database. I have copied valgrind log here. Used the below code to create and delete the connection. Please advice me to resolve the issue.
Sample Code:
while(1)
{
Connection* con = DriverManager::getConnection(ConnectionString);
if(con != NULL)
{
delete con;
con = NULL;
}
}
Valgrind Log:
==7534== 283,173,984 (1,074,640 direct, 282,099,344 indirect) bytes in 9,595 blocks are definitely lost in loss record 7,279 of 7,279
==7534== at 0x4CE9B0F: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==7534== by 0x6FEB3B7: __gconv_open (gconv_open.c:74)
==7534== by 0x6FEB070: iconv_open (iconv_open.c:40)
==7534== by 0x3172BEB: unicode_setup (__info.c:601)
==7534== by 0x3136BD7: __SQLAllocHandle (SQLAllocHandle.c:492)
==7534== by 0x310DC4F: odbc::DriverManager::_createConnection() (drivermanager.cpp:140)
==7534== by 0x310DDBC: odbc::DriverManager::getConnection(std::__cxx11::basic_string<char, std::char_traits\<char="">, std::allocator\<char> > const&, std::__cxx11::basic_string<char, std::char_traits\<char="">, std::allocator\<char> > const&, std::__cxx11::basic_string<char, std::char_traits\<char="">, std::allocator\<char> > const&) (drivermanager.cpp:183)
==7534== by 0x</char></char,></char></char,></char></char,>
Thank you for this information, I will try to look into this tomarrow. (Monday)