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

Home -> Community -> Usenet -> c.d.o.tools -> Thousands of lingering OracleCancelThreads

Thousands of lingering OracleCancelThreads

From: Anastasios Kotsikonas <tasos_at_csa.bu.edu>
Date: 2000/04/21
Message-ID: <8dq8kc$1ld$1@news3.bu.edu>#1/1

Hi,

we set the query timeouts on statements to 60 seconds usually and after a lot of UPDATEs and INSERTs our Java (1.2.2) VM has up to 2100 lingering threads with the following stack trace:

"Thread-25197" (TID:0xce67b4, sys_thread_t:0xce6738, state:CW, thread_t: t_at_25360, threadID:0xa9603dc8, stack_bottom:0xa9604000, stack_size:0x100000) prio=5

[1]java.lang.Thread.sleep(Native Method)
[2]oracle.jdbc.driver.OracleCancelThread.run(OracleCancelThread.java:47)
river.OracleCancelThread.run(OracleCancelThread.java:47)

During the course of execution up to 103,000 such threads are generated, but most of them die, except for those few thousand. Then the VM halts. Meantime, the console throws a lot of:

java.lang.NullPointerException
at oracle.jdbc.driver.OracleStatement.cancel(Compiled Code)
at oracle.jdbc.driver.OracleCancelThread.run(Compiled Code)

This is with the 8.1.6 JDBC thin driver and Oracle 8.1.5 on Solaris 2.7.

The number of threads left behind can vary between 100 to about 2100 before the VM halts.

The questions are as follows:

  1. What's up with the null pointers?
  2. When does a cancel thread get created and why would one have anywhere from 100 to 2100 such Oracle threads running?
  3. Does Statement.setQueryTimeout() create that thread, and do repeated calls create more threads? What if the argument is zero, i.e. no query timeout? Does the thread exit?
  4. Do these threads exit when a connection is closed or garbage collected?

Any fixes in the driver?

Our server keeps connections open all the time to the Oracle server, and we usually create a Statement, set the timeout, execute it and then close() it and set it to null.

thanks

-t Received on Fri Apr 21 2000 - 00:00:00 CDT

Original text of this message

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