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 -> help!"EXEC SQL ENABLE THREADS" cause memory leak?

help!"EXEC SQL ENABLE THREADS" cause memory leak?

From: cellecial <cellecial_at_21cn.com>
Date: Sun, 11 Dec 2005 20:49:17 +0800
Message-ID: <dnh7du$e15$1@news.yaako.com>


Hi,all

Environment: HPUX11.11 ORACLE9i

I wrote a test program,just like lines below:

/*********************************/

main()
{

....
char array_a[64];
EXEC SQL END DECLARE SECTION; EXEC SQL ENABLE THREADS;
EXEC SQL CONNECT :loginuser IDENTIFIED BY :usrpwd USING :dbstr; ......

while(1)
{

    EXEC SQL SELECT field_a INTO :array_a FROM table_a WHERE field_b=122; }

}

/*********************************/

When I excute this program and monitor its performance with "top" on HPUX, I found the values of column "size" and "res" of the program increased ceaselessly.
After a few minutes,the value of column "res" reached 100M.

When I remove the line "EXEC SQL ENABLE THREADS;",the values keep a fixed number and didn't increase any more.

But why? Why does this line cause memory leak?

Because I will write a multithread application,so I must use "EXEC SQL ENABLE THREADS".
But if "EXEC SQL ENABLE THREADS" can cause so much memory leak,how can the application run normally and not exit because of "out of memory"?

Any help will be appreciated,thank you very much.

Can anybody tell me how solve the problem? Received on Sun Dec 11 2005 - 06:49:17 CST

Original text of this message

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