Dynamic SQL meth. 4/memory

From: <steve_at_sdz01.uu.ch>
Date: Fri, 16 Oct 1992 13:23:38 GMT
Message-ID: <1992Oct16.132338.4168_at_sdz01.uu.ch>


I've developed an application using embedded dynamic SQL (method 4). The actual database code (written with PROC, not the OCI) runs in a daemon process. I've noticed that the size of this process grows in 96K chunks each time I save a record in the database. After enough transactions, this memory becomes a problem.

The 96K size is probably not directly relevant, as the transaction actually consists of a series of transactions. But for each (identical) series, the size increase is identical.

First I checked that I was allocating and deallocating everything correctly, and I am. I allocate my bind and select desriptors with sqlald(), and free them with sqlclu(). I allocate a bit of additional memory with realloc(), but that definitely gets free'd, too. In any case, the memory I allocate is much smaller (on the order of hundreds or perhaps a couple of thousand bytes) than the increase (as shown by sbrk()).

I checked to make sure I was closing the declared cursor each time, and I am. I checked to make sure I was committing work each time, and I am.

As an experiment, after each transaction I released and reconnected the database, just to see what happens, and after the reconnect, the memory usage immediately starts to increase again. I didn't expect it to decrease, since the process size can't shrink, but I thought perhaps memory allocated by Oracle for me would then be reused. In any case, releasing and reconnecting has no effect.

My hardware configuration is Decstation 5000/200 w/32 MB physical memory, and lots of swap space. I'm running Ultrix 4.2A. I have the problem with both Oracle 6.0.36 and 6.0.27.

I'm a bit of a novice at this database thing, so I would be perfectly happy to find out I am doing something stupid. In the meantime I've found a rather ugly workaround, but it won't do in the long run. If anyone could help me ...

Steve Husting
Pinck Softech AG
Reinach, Switzerland Received on Fri Oct 16 1992 - 14:23:38 CET

Original text of this message