help!"EXEC SQL ENABLE THREADS" cause memory leak?
Date: Sun, 11 Dec 2005 20:49:17 +0800
Message-ID: <dnh7du$e15$1_at_news.yaako.com>
[Quoted] 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 - 13:49:17 CET