X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id C2EDD529EF for ; Fri, 1 Jul 2005 06:04:53 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 43722-04 for ; Fri, 1 Jul 2005 09:04:48 +0000 (GMT) Received: from delta.hssblr.co.in (unknown [61.16.168.135]) by svr1.postgresql.org (Postfix) with ESMTP id 16FC552800 for ; Fri, 1 Jul 2005 06:04:41 -0300 (ADT) Received: from espion.blr.hss.hns.com (espion.blr.hss.hns.com [10.203.193.21]) by delta.hssblr.co.in (8.11.6/8.11.6) with ESMTP id j6194ei01762 for ; Fri, 1 Jul 2005 14:34:40 +0530 Subject: SQLCloseCursor() or SQLFreeStmt does not free memory allcated to read CLOB field in Oracle. To: pgsql-sql@postgresql.org X-Mailer: Lotus Notes Release 6.5.1 January 21, 2004 Message-ID: From: Vadivel Subramaniam Date: Fri, 1 Jul 2005 14:34:32 +0530 X-MIMETrack: Serialize by Router on Espion/BLR/HSS(Release 6.5|September 18, 2003) at 07/01/2005 02:39:12 PM MIME-Version: 1.0 Content-type: text/plain; charset=ISO-8859-1 Content-transfer-encoding: quoted-printable X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.05 tagged_above=0 required=5 tests=FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200507/2 X-Sequence-Number: 21980 = Hi, = = This is query realated to ODBC and CLOB field in Oracle. I feel some o= f you might have faced similar issue. Any hint would help me. = = = I am using a C++ application that connects to Oracle Database using = EasySoft ODBC driver. I face a strange problem when freeing the memory= after i fetch the CLOB data from the Oracle table. = = = The piece of Code is below, = = = =A0 =A0char *pClobBuffer =3D new char[10485670]; =A0// 10 MB = = = =A0 // Prepare the SQL statement =A0 =A0strcpy(pQuery, "SELECT clob= data FROM clobtable") = = = =A0 =A0/* Execute the SQL statement. Check for errors. = */ =A0 =A0SQLExecDirect(stmtHandle,(SQLC=AD=ADHAR*)pQuery,SQL_NTS);= =A0 =A0SQLFetch(st mtHandle); =A0 =A0SQLGetData(stmtHandle, 1, SQL_C_CHAR, clobBuffer,= 10485670,&dError); =A0 =A0SQLCloseCursor(stmtHandle); =A0 =A0del= ete []pClobBuffer; = = The statement and connection handles are closed properly. Still i am = seeing the memory usage is exactly increasing by 10 MB(size of the buf= fer we allocated to read the CLOB) for each query. = = = This is not a memory leak, it's only the memory usage which is increas= ing for the process for every query involving this CLOB field. = = = I tried changing the CLOB to Varchar in the database table, the above = piece of Code works without increase in memory usage. = = = NOTE: =A0We observed there is some special handling required to free t= he memory buffer allocated to read the CLOB field. =A0In DB2 site they ar= e saying SQLFreeStmt does not free the CLOB fields, FREE Alocator statem= ent must be used. = = = Please suggest me if any special handling is required for ORACLE to fr= ee the CLOB data. = = = Our Env: =A0C++, Solaris, ODBC, ORACLE, EasySoft driver = = = thanks, = Vadivel. = = *********************** FSS-Private *********************** "DISCLAIMER: This message is proprietary to Flextronics Software System= s Limited (FSS) and is intended solely for the use of the individual to whom it is addressed. It may contain privileged or confidential information and should not be circulated or used for any purpose other than for what it is intended. If you have received th= is message in error, please notify the originator immediately. If you are not the intended recipient, you are notified that you are strictly prohibited from using, copying, altering, or disclosing the contents of this message. FSS accepts no responsibility for los= s or damage arising from the use of the information transmitted by this email including damage from virus."=