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

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

From: IANAL_VISTA <IANAL_Vista_at_hotmail.com>
Date: Sun, 11 Dec 2005 16:00:55 GMT
Message-ID: <Xns972951ACF68F9SunnySD@70.168.83.30>


"cellecial" <cellecial_at_21cn.com> wrote in news:dnh7du$e15$1_at_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?
>
>
>

From my perspective, what you descibe is expected behavior. You've coded an infinite loop which populates a memory array. So of course the process RAM consumption will increase. PEBKAC! If you want the pain to cease, stop poking yourself in the eye. Received on Sun Dec 11 2005 - 10:00:55 CST

Original text of this message

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