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

Home -> Community -> Usenet -> c.d.o.misc -> Memory leak in threads?

Memory leak in threads?

From: PodJudzacz <zientek_at_wasko.pl>
Date: Thu, 22 Jul 2004 12:03:45 +0200
Message-ID: <cdo3d6$13nd$1@news2.ipartners.pl>


Hi,
  I have a problem using Oracle in threads.   While running code below, process swell in memory. Environment: Solaris e10, Oracle 9i, SQL/C precompiler - proc 9.2.0.1.0, gcc 2.95.2. Real process is a deamon, so it crashes consumming all RAM in few hours. Using context in thread is not necessary to reach this effect (one line - EXEC SQL COMMIT WORK RELEASE; in void* f(void*) is enough).

Kind regards
PodJudzacz

using std::cout;
pthread_t tid;
void* f(void* x);

int main(int c, char *s[]){
  while(true){
    cout<<pthread_create(&tid,NULL,f,NULL)<<endl;     pthread_join(tid,0);
  }
}

void* f(void* x){
  EXEC SQL ENABLE THREADS;
  EXEC SQL CONTEXT ALLOCATE :ctx;
  EXEC SQL CONTEXT USE :ctx;
  EXEC SQL CONTEXT FREE :ctx;
}
Received on Thu Jul 22 2004 - 05:03:45 CDT

Original text of this message

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