Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Oracle Memory Leak Using Prepare Statement

Oracle Memory Leak Using Prepare Statement

From: <gladden_at_ictt.com>
Date: Wed, 29 Dec 1999 18:31:23 GMT
Message-ID: <84djgd$4ha$1@nnrp1.deja.com>


I came across numerous postings on DejaNews pertaining to a memory leak when using the Oracle PREPARE statement to build dynamic queries and FETCHing records using a CURSOR. I am having the same problem with Oracle 7.3.4.1 running on HPUX 10.20. The following lines of code generate about a 4Kbyte memory leak each time it is called:

sprintf( query_buffer, "SELECT a,b,c FROM t WHERE x=%d AND y=%d AND z=%d ORDER BY a", x, y, z);

EXEC SQL PREPARE s1 FROM :query_buffer; EXEC SQL DECLARE c1 CURSOR FOR s1;
EXEC SQL OPEN c1;
while ( ...)
{

    EXEC SQL FETCH c1

        INTO ...
}
EXEC SQL CLOSE c1;

I believe the memory leak is based on the size of the query buffer (char query_buffer[3072]).

Has anyone ever gotten any resolution to this problem. I have tried a number of times to contact Oracle Technical Support to check on a patch with no luck (you probably know how that goes).

Any insights to this problem would be greatly appreciated!

Keith E. Gladden
ICTT, Inc.
Systems Engineer

Tel: 812.232.3991
Fax: 812.232.2998
gladden_at_ictt.com


Sent via Deja.com http://www.deja.com/
Before you buy. Received on Wed Dec 29 1999 - 12:31:23 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US