Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Re: OCIParamGet memory leak
Hi and see comments below:
> Assuming I have created a statement and executed it, should the
> following loop leak memory?
>
> OCIParam *mypard=0;
> ub4 counter;
> sb4 parm_status;
>
> counter = 1;
>
> for (int xx=0;xx<100000;++xx) {
> parm_status = OCIParamGet(sp, OCI_HTYPE_STMT, errhp,
> reinterpret_cast<void**>(&mypard),
> (ub4) counter);
> }
Is it real for() loop or just for an example?
Help me with the following things:
D'you really have 100000 columns for your statement ???
D'you really do not check return code of OCIParamGet() for OCI_NO_DATA?
(or 100000 is a result of the previous call of OCIAttrGet() with
OCI_ATTR_PARAM_COUNT ?)
And, last, what is the use to call OCIParamGet() 100000 times
with the same value of the last parameter - I mean "counter"?
If this is a real code ...
If this is just for an example let me see your real code.
>
> I leak a few MBs of memory with the above. I am using the OCI library
> provided with Oracle 8.1.6 for Linux. Can someone clue me in on why
> this is happening?
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
>
Sent via Deja.com http://www.deja.com/
Before you buy.
Received on Wed Oct 25 2000 - 05:54:46 CDT
![]() |
![]() |