Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Memory leak in threads?
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