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: Oracle memory issue

Re: Oracle memory issue

From: Thomas Kyte <tkyte_at_us.oracle.com>
Date: Mon, 02 Nov 1998 21:03:16 GMT
Message-ID: <36421d8b.27716404@192.86.155.100>


A copy of this was sent to howard_guarini_at_den.invesco.com (if that email address didn't require changing) On Mon, 02 Nov 1998 20:24:13 GMT, you wrote:

>We are on version 8.03 of Oracle using sun solaris. We are expierencing
>a memory leak in Oracle. Every time a user logs on we allocate memory
>to them but it does not free up when they logoff. Have any of you guys
>heard of this and if yes would you know of a solution.
>Thanx
>Mitch

Can you give an example? I just wrote a program that logs on, logs off and measures memory usage using "ps" to get the process SIZE and RSS (resident set size). After the first logon, it is constant:

$ ./leak

tkyte    12125  0.1  0.8 6248 3896 pts/9    S 15:58:43  0:00 ./leak
tkyte    12125  0.2  0.8 6392 4048 pts/9    S 15:58:43  0:00 ./leak
tkyte    12125  0.2  0.8 6392 4048 pts/9    S 15:58:43  0:00 ./leak
tkyte    12125  0.2  0.8 6392 4048 pts/9    S 15:58:43  0:00 ./leak
tkyte    12125  0.2  0.8 6392 4048 pts/9    S 15:58:43  0:00 ./leak
tkyte    12125  0.3  0.8 6392 4048 pts/9    S 15:58:43  0:00 ./leak
tkyte    12125  0.3  0.8 6392 4048 pts/9    S 15:58:43  0:00 ./leak
tkyte    12125  0.3  0.8 6392 4048 pts/9    S 15:58:43  0:00 ./leak
tkyte    12125  0.3  0.8 6392 4048 pts/9    S 15:58:43  0:00 ./leak
tkyte    12125  0.3  0.8 6392 4048 pts/9    S 15:58:43  0:00 ./leak
tkyte    12125  0.3  0.8 6392 4048 pts/9    S 15:58:43  0:00 ./leak
tkyte    12125  0.4  0.8 6392 4048 pts/9    S 15:58:43  0:00 ./leak
tkyte    12125  0.4  0.8 6392 4048 pts/9    S 15:58:43  0:00 ./leak
tkyte    12125  0.4  0.8 6392 4048 pts/9    S 15:58:43  0:00 ./leak
tkyte    12125  0.4  0.8 6392 4048 pts/9    S 15:58:43  0:00 ./leak
tkyte    12125  0.4  0.8 6392 4048 pts/9    S 15:58:43  0:00 ./leak
tkyte    12125  0.4  0.8 6392 4048 pts/9    S 15:58:43  0:00 ./leak
tkyte    12125  0.5  0.8 6392 4048 pts/9    S 15:58:43  0:00 ./leak
tkyte    12125  0.5  0.8 6392 4048 pts/9    S 15:58:43  0:00 ./leak

The code used was:

#include <stdio.h>

#define SQLCA_INIT
EXEC SQL INCLUDE sqlca;

static void sqlerror_hard()
{

    EXEC SQL WHENEVER SQLERROR CONTINUE;     printf("\nORACLE error detected:");     printf("\n% .70s \n", sqlca.sqlerrm.sqlerrmc);

    EXEC SQL ROLLBACK WORK RELEASE;
    exit(1);
}

static void sqlerror_soft()
{

    EXEC SQL WHENEVER SQLERROR CONTINUE;     printf("\nORACLE error detected:");     printf("\n% .70s \n", sqlca.sqlerrm.sqlerrmc); }

static void process()
{
EXEC SQL BEGIN DECLARE SECTION;
VARCHAR oracleid[50] = { strlen("tkyte/tkyte"), "tkyte/tkyte" }; EXEC SQL END DECLARE SECTION;     EXEC SQL WHENEVER SQLERROR DO sqlerror_hard();

    EXEC SQL CONNECT :oracleid;
    system( "/usr/ucb/ps -auxww | grep leak | grep -v grep" );

    /* Disconnect from ORACLE. */
    EXEC SQL COMMIT WORK RELEASE;
}

main( argc, argv )
int argc;
char * argv[];
{
int i;

    for( i = 0; i < 100; i++ )

        process();
    exit(0);
}

Does it behave differently on your system?

I used solaris 2.6, oracle 8.0.3...

>
>REPLY TO: mitch.gold_at_mci.com
>
>-----------== Posted via Deja News, The Discussion Network ==----------
>http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own
 

Thomas Kyte
tkyte_at_us.oracle.com
Oracle Government
Herndon VA

--
http://govt.us.oracle.com/ -- downloadable utilities  



Opinions are mine and do not necessarily reflect those of Oracle Corporation  

Anti-Anti Spam Msg: if you want an answer emailed to you, you have to make it easy to get email to you. Any bounced email will be treated the same way i treat SPAM-- I delete it. Received on Mon Nov 02 1998 - 15:03:16 CST

Original text of this message

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