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: Rob Zijlstra <rj.zijlstra_at_tiscali.nl>
Date: Sun, 11 Dec 2005 20:46:42 +0100
Message-ID: <8e0pp1h2hjrnemh1bo0516ah8na0jh9f3r@4ax.com>


On Sun, 11 Dec 2005 16:00:55 GMT, "IANAL_VISTA" <IANAL_Vista_at_hotmail.com> wrote:

>"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.

How many problems do you have? You are wasting my time / bandwith with cross - posting in 4 groups.

Please have the minimal courtesy to ask 1 question in 1 group.

Have a nice day....
Best Regards

Rob Zijlstra Received on Sun Dec 11 2005 - 13:46:42 CST

Original text of this message

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