0 Replies Latest reply on Jan 26, 2004 4:12 AM by csaba_meszaros

    HSQL consumig threads

    csaba_meszaros

      HI,

      We are experiencing a strange behaviour of the HSQL datasource. Our application, jBoss 3.2.1 with embedded jetty, runs on RedHat kernel 2.4.9. After a day run in a production equal environment or after 2-3 hours of stress test the thread dump reveals about 1700 open threads, and the app slows down to halt. There are about 1500 threads, running in org.hsqldb.Log, as the following shows:

      "Thread-1562" prio=1 tid=0x93a66610 nid=0x4b35 waiting on condition [94503000..945038c8]
       at java.lang.Thread.sleep(Native Method)
       at org.hsqldb.Log.run(Unknown Source)
       at java.lang.Thread.run(Thread.java:534)


      HSQL is used to handle the JMS queues. It is configured to run in-process (in deploy/hsqlbd-ds.xml)

      <datasources>
       <local-tx-datasource>
       <jndi-name>DefaultDS</jndi-name>
       <connection-url>jdbc:hsqldb:default-db-name</connection-url>
       <driver-class>org.hsqldb.jdbcDriver</driver-class>
       <min-pool-size>5</min-pool-size>
       <security-domain>HsqlDbRealm</security-domain>
       </local-tx-datasource>
      </datasources>


      As the org.hsqldb.Log.run method is nothing but an endless loop to flush the buffer, I was wandering who is creating these threads, and how to avoid them:

      public void run() {
       while(tRunner!=null) {
       try {
       tRunner.sleep(1000);
       if(bNeedFlush) {
       wScript.flush();
       bNeedFlush=false;
       }
       // todo: try to do Cache.cleanUp() here, too
       } catch(Exception e) {
       // ignore exceptions; may be InterruptedException or IOException
       }
       }
       }


      Is there any way to avoid this strange behaviour?