Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Re: OCIParamGet memory leak

Re: OCIParamGet memory leak

From: <edwardmi1_at_my-deja.com>
Date: Fri, 27 Oct 2000 07:39:45 GMT
Message-ID: <8tbbg1$310$1@nnrp1.deja.com>

Hi, I've looked through your code - it's very close to demo and the new code you've added cannot cause such sort of the memory leakage. There were many examples of using explicit and implicit describe of dynamic queries in my applications and I hadn't got any memory leakage (at least so huge).

May be you confused a memory leakage with allocation of memory during the Init, Attach and Begin calls? It's an expected 'leakage'. Unfortunately.

Edward,
OraDev.

An inessentual notice that doesn't require any answer:
>static text *selemp = (text *)"SELECT ename job FROM emp";
job is an alias for ename or comma was missed?

> Sorry, my last reply got truncated for some reason.
>
> Yes, this is just some example code which highlights the memory leak.
 I
> modified the cdemo81.c example program that ships with Oracle and
 added
> this bogus loop. Here is the real code. I added the part indicated
 by
> the "/* new code */" comment.
>

 ==cut==
> edwardmi1_at_my-deja.com wrote:
> > 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.
> >
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
>

Sent via Deja.com http://www.deja.com/
Before you buy. Received on Fri Oct 27 2000 - 02:39:45 CDT

Original text of this message

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