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: Rollback in ProC caused memory leak?

Re: Rollback in ProC caused memory leak?

From: Doug Barnes <dwb_at_rell.com>
Date: 1997/04/17
Message-ID: <3356D54B.46A4@rell.com>#1/1

Nick Chen wrote:
>
> We recently encountered a quite intriguing memory leak problem coming from the
> following Oracle Pro*C routine:
>
> #include <sqlca.h>
> #include <DBIntf.h>
>
> long RollbackData (void *ConnectID)
> {
> long ErrorCode;
>
> EXEC SQL ROLLBACK;
> ErrorCode = sqlca.sqlcode;
>
> return (ErrorCode);
> }
>
> Every time this routine was executed, we can observed several 32-byte nodes
> were added to the ever growing doubly-linked list by examining the heap memory
> map.
>
> Some characteristic of our server application:
>
> - the server is compiled with Pro*C/C++: Release 2.2.2.0.0 running on
> HPUX 10.01 and accessing Oracle server 7.3.2.
> - it uses ProC to connect and access the oracle database.
> - after the connection, the server will run continuously for six days
> before shut down on Sunday.
> - the server is reading requests from the message queue thus no fork
> was done.
> - the server processes roughly 1500 transactions an hour.
> - the server is leaking memory at a rate of 160K bytes per hour. So
> after 6 days, the server's heap size will grow roughly 24M bytes
> more.
> - there are 18 identical server processes running at the same time, so
> after 6 days, the total memory usage for those server is roughly
> 450M bytes.
> - many requests to the server were error thus the above rollback
> ProC routine were called frequently.
>
> It seemed that when doing a rollback, Oracle/ProC was keeping a history or
> journal of some sort. And this list seemed like a privately maintained global
> doubly-linked list. A typical node of the list looked like the following:
>
> 0x0000beef 0x403422c8 0x40342318 0x8b01d217
> 0x00000000 0x16004353 0x0000beef 0x8b01d217
>
> Where 0x0000beef looks like a magic word, 0x403422c8 is the left pointer, and
> 0x40342318 is the right pointer of a doubly-linked list. I was able to
> confirmed that 0x0000beef word also appeared in libsql.a so this node
> structure seemed to be defined in libsql.a.
>
> Now the tough question, how do we tell Oracle/ProC not to maintained this ever
> growing internal list? Thanks in advance for your help.
>
> --
> +-----------------------------------+
> | Nick Chen 703-713-2584 |
> | AT&T, Herndon, VA |
> | ccserve!nchen_at_polaris.attmail.com |
> | nickchen_at_attmail.com |
> +-----------------------------------+
> --
> +-----------------------------------+
> | Nick Chen 703-713-2584 |
> | AT&T, Herndon, VA |
> | ccserve!nchen_at_polaris.attmail.com |
> | nickchen_at_attmail.com |
> +-----------------------------------+

Try to determine another way to perform your task (which is???). Received on Thu Apr 17 1997 - 00:00:00 CDT

Original text of this message

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