Thread: Memory Leak ?
View Single Post

   
  #1 (permalink)  
Old 04-16-2008, 03:00 AM
zhaoxin
 
Posts: n/a
Default Memory Leak ?

Hi,
I have a C++ application for testing memory leak that connects to
PostgreSQL8.1.3 Database using psqlODBC 08.01.02.00 unicode driver.
I have found some memory leak with the windows performance tool.
I have tried to upgrade the psqlODBC to 08.02.0002 ,but the leak still
exists.

The piece of my Code is like this:
SQLAllocHandle (SQL_HANDLE_ENV, NULL, &henv);
SQLAllocHandle(SQL_HANDLE_DBC, henv, &hdbc);
SQLConnect (hDBC, szDSN, SQL_NTS, szUID, SQL_NTS, szPasswd, SQL_NTS);
SQLAllocHandle(SQL_HANDLE_STMT, hdbc, &hstmt);
while( i < 10){
SQLPrepare(hstmt,(SQLCHAR*)szSql, SQL_NTS);
SQLBindParameter(......);
......
SQLExecute(hstmt);
SQLFreeStmt(hstmt,SQL_RESET_PARAMS);
}
SQLEndTran(SQL_HANDLE_DBC,(SQLHDBC)hdbc, SQL_COMMIT);
SQLFreeStmt(hstmt, SQL_CLOSE);
SQLFreeHandle(SQL_HANDLE_STMT, hstmt);
SQLDisconnect(hdbc);
SQLFreeHandle(SQL_HANDLE_DBC, hdbc);

my Env: VC.net, windows2003 server, PostgreSQL8.1.3

some of you have faced similar issue for memory leak?
or I have made some misstake in Using the Odbc function?
If you could help me, that would be great!

thanks,
zhao




---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match

Reply With Quote