Re: Dynamic SQL meth. 4/memory

From: Andy Finkenstadt <andy_at_homebase.vistachrome.com>
Date: Sun, 18 Oct 1992 18:48:24 GMT
Message-ID: <1992Oct18.184824.3902_at_homebase.vistachrome.com>


You may want to use the malloc() package from INN (internetwork news) by rich salz. It has an optimized malloc() that allocates memory in sizes of powers of two and never splits an area in half. From your description of the problem it sounds as though Oracle releases the memory but then allocates it again and your current malloc() library splits apart the freed memory.
-Andy

In comp.databases.oracle you write:
>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

--
| |  Andrew Finkenstadt, 110 Broward Street #101, Tallahassee FL 32310 USA  | |
 o|  GEnie Unix Sysop,   401 North Washington St, Rockville   MD 20850 USA  |o|
| |  andy_at_genie.geis.com andy_at_vistachrome.com uunet!rde!andy  NIC:AF136     | |
|o|  +1 904 222 2639 home, +1 904 575 0189 work, +1 904 574 6247 fax        |o|
|-|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|-|
|o|  Send mail to ora-request_at_vistachrome.com to join Unix, CASE, and       |o|
| |  Desktop Oracle RDBMS Database discussions.                             | |
 
-- 
| |  Andrew Finkenstadt, 110 Broward Street #101, Tallahassee FL 32310 USA  | |
|o|  GEnie Unix Sysop,   401 North Washington St, Rockville   MD 20850 USA  |o|
| |  andy_at_genie.geis.com andy_at_vistachrome.com uunet!rde!andy  NIC:AF136     | |
|o|  +1 904 222 2639 home, +1 904 575 0189 work, +1 904 574 6247 fax        |o|
|-|- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -|-|
|o|  Send mail to ora-request_at_vistachrome.com to join Unix, CASE, and       |o|
| |  Desktop Oracle RDBMS Database discussions.                             | |
Received on Sun Oct 18 1992 - 19:48:24 CET

Original text of this message