pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: zhaoxin <zhaox@necas.nec.com.cn>
To: pgsql-odbc@postgresql.org
Subject: Memory Leak ?
Date: Thu, 08 Jun 2006 17:01:31 +0800
Message-ID: <4487E76B.4000805@necas.nec.com.cn> (raw)

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






view thread (21+ messages)  latest in thread

Message-ID: <4487E76B.4000805@necas.nec.com.cn>
Permalink:  ../4487E76B.4000805@necas.nec.com.cn/
Also on:    postgresql.org/message-id/4487E76B.4000805@necas.nec.com.cn

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-odbc@postgresql.org
  Cc: zhaox@necas.nec.com.cn
  Subject: Re: Memory Leak ?
  In-Reply-To: <4487E76B.4000805@necas.nec.com.cn>
  References: <4487E76B.4000805@necas.nec.com.cn>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox