<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#ffffff">
    Hi,<br>
    <br>
    i don't have the problems with the thread accumulation, because i do
    not create so many connections, but i see the point that creating a
    thread for every machine you connect to can lead to such problems. I
    think the main problem is that jcifs is using blocking io instead of
    non-blocking io. I made some experiments to use non-blocking io in
    jcifs and handle the io with some small amount of threads, but it is
    far away from beeing ready for a first review by the community and
    the commiters(i am not a commiter) of jcifs.<br>
    <br>
    The question i have is: "are there many/some users of jcifs who are
    using many connections in a single jvm-process?" <br>
    <br>
    -- Sebastian<br>
    <br>
    Am 17.10.2011 22:58, schrieb Colin Hay:
    <blockquote
      cite="mid:03C51948ABE7AC4CAF8332DA9F76872D37AB106E@Q1EXCH03.Q1LABS.INC"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html;
        charset=ISO-8859-1">
      <meta name="Generator" content="Microsoft Word 11 (filtered
        medium)">
      <style>
<!--
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:Arial;
        color:windowtext;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
        {page:Section1;}
 /* List Definitions */
 @list l0
        {mso-list-id:911156126;
        mso-list-type:hybrid;
        mso-list-template-ids:1752327702 67698711 67698713 67698715 67698703 67698713 67698715 67698703 67698713 67698715;}
@list l0:level1
        {mso-level-number-format:alpha-lower;
        mso-level-text:"%1\)";
        mso-level-tab-stop:.75in;
        mso-level-number-position:left;
        margin-left:.75in;
        text-indent:-.25in;}
ol
        {margin-bottom:0in;}
ul
        {margin-bottom:0in;}
-->
</style>
      <div class="Section1">
        <p class="MsoNormal"><font face="Arial" size="2"><span
              style="font-size: 10pt; font-family: Arial;">Hi all,<o:p></o:p></span></font></p>
        <p class="MsoNormal"><font face="Arial" size="2"><span
              style="font-size: 10pt; font-family: Arial;"><o:p> </o:p></span></font></p>
        <p class="MsoNormal"><font face="Arial" size="2"><span
              style="font-size: 10pt; font-family: Arial;">I apologize
              if this lacks a degree of specificity (and evidence); I’ve
              inherited some jcifs-related work from a former co-worker
              and am essentially trying to get caught up on what he did.
              This is really intended as a disclosure of some changes we
              made to jcifs rather than a request for help; we seem to
              have the issue resolved but since jcifs is licensed under
              the LGPL I figure we should share the alterations with the
              community in case they might be useful to others, and
              maybe they can be considered for inclusion in a later
              release of jcifs.<o:p></o:p></span></font></p>
        <p class="MsoNormal"><font face="Arial" size="2"><span
              style="font-size: 10pt; font-family: Arial;"><o:p> </o:p></span></font></p>
        <p class="MsoNormal"><font face="Arial" size="2"><span
              style="font-size: 10pt; font-family: Arial;">My company’s
              product uses jcifs to connect to a number of remote
              windows machines (depending on the customer, this could be
              just a handful, or several hundred). We have two
              components that make use of jcifs for different purposes;
              each employs its own retry mechanism. One utilizes a retry
              queue such that if a given connection attempt to a remote
              machine does not complete successfully within 45 seconds,
              we wait 30 seconds and make another connection attempt. We
              keep trying every 30 seconds until success. The other
              component doubles its wait interval between each retry
              attempt; starting at 1 second for the first connect
              failure, 2 seconds for the second, 4 seconds for the
              third, etc, though we max out at 15 minutes.<o:p></o:p></span></font></p>
        <p class="MsoNormal"><font face="Arial" size="2"><span
              style="font-size: 10pt; font-family: Arial;"><o:p> </o:p></span></font></p>
        <p class="MsoNormal"><font face="Arial" size="2"><span
              style="font-size: 10pt; font-family: Arial;">A while back
              we came across a problem where we were accumulating
              threads at a rate such that we would eventually hit an OOM
              that would kill our jvm. This was because the windows
              machines we were trying to connect to were not responsive,
              and whatever issue they were having resulted in the
              threads created in
              jcifs.util.transport.Transport.connect(long timeout)
              blocking and staying active even after the timeout expired
              and the reference to the thread was nullified by the
              creating thread. The next time a connect attempt was
              initiated, another thread would be created in the
              connect() method, and this would continue until we had a
              serious problem on our hands because of the accumulation
              of stranded blocked threads. I can’t give details as to
              what the threads were blocking on because I can’t find any
              thread dumps from when the original issue was
              investigated, nor any explanation as to how to reproduce
              the problem (it was discovered at a customer site).<o:p></o:p></span></font></p>
        <p class="MsoNormal"><font face="Arial" size="2"><span
              style="font-size: 10pt; font-family: Arial;"><o:p> </o:p></span></font></p>
        <p class="MsoNormal"><font face="Arial" size="2"><span
              style="font-size: 10pt; font-family: Arial;">My
              predecessor’s solution to this was to:<o:p></o:p></span></font></p>
        <p class="MsoNormal"><font face="Arial" size="2"><span
              style="font-size: 10pt; font-family: Arial;"><o:p> </o:p></span></font></p>
        <p class="MsoNormal" style="margin-left: 0.75in; text-indent:
          -0.25in;">
          <!--[if !supportLists]--><font face="Arial" size="2"><span
              style="font-size: 10pt; font-family: Arial;"><span
                style="">a)<font face="Times New Roman" size="1"><span
                    style="font: 7pt "Times New Roman";">      
                  </span></font></span></span></font><!--[endif]--><font
            face="Arial" size="2"><span style="font-size: 10pt;
              font-family: Arial;">add a thread.interrupt() call to the
              synchronized(thread){} block of
              jcifs.util.transport.Transport.connect(long timeout) in an
              effort to make sure the thread does not hang around
              forever:<o:p></o:p></span></font></p>
        <p class="MsoNormal"><font face="Arial" size="2"><span
              style="font-size: 10pt; font-family: Arial;"><o:p> </o:p></span></font></p>
        <p class="MsoNormal" style="margin-left: 0.5in; text-indent:
          0.5in;">
          <b><font color="#7f0055" face="Courier New" size="2"><span
                style="font-size: 10pt; font-family: "Courier
                New"; color: rgb(127, 0, 85); font-weight: bold;">synchronized</span></font></b><font
            color="black" face="Courier New" size="2"><span
              style="font-size: 10pt; font-family: "Courier
              New"; color: black;"> (</span></font><font
            color="#0000c0" face="Courier New" size="2"><span
              style="font-size: 10pt; font-family: "Courier
              New"; color: rgb(0, 0, 192);">thread</span></font><font
            color="black" face="Courier New" size="2"><span
              style="font-size: 10pt; font-family: "Courier
              New"; color: black;">) {</span></font><font
            face="Courier New" size="2"><span style="font-size: 10pt;
              font-family: "Courier New";"><o:p></o:p></span></font></p>
        <p class="MsoNormal" style=""><font color="black" face="Courier
            New" size="2"><span style="font-size: 10pt; font-family:
              "Courier New"; color: black;">               
            </span></font><font color="#0000c0" face="Courier New"
            size="2"><span style="font-size: 10pt; font-family:
              "Courier New"; color: rgb(0, 0, 192);">thread</span></font><font
            color="black" face="Courier New" size="2"><span
              style="font-size: 10pt; font-family: "Courier
              New"; color: black;">.start();</span></font><font
            face="Courier New" size="2"><span style="font-size: 10pt;
              font-family: "Courier New";"><o:p></o:p></span></font></p>
        <p class="MsoNormal" style=""><font color="black" face="Courier
            New" size="2"><span style="font-size: 10pt; font-family:
              "Courier New"; color: black;">               
            </span></font><font color="#0000c0" face="Courier New"
            size="2"><span style="font-size: 10pt; font-family:
              "Courier New"; color: rgb(0, 0, 192);">thread</span></font><font
            color="black" face="Courier New" size="2"><span
              style="font-size: 10pt; font-family: "Courier
              New"; color: black;">.wait( timeout );          </span></font><font
            color="#3f7f5f" face="Courier New" size="2"><span
              style="font-size: 10pt; font-family: "Courier
              New"; color: rgb(63, 127, 95);">/* wait for doConnect
              */</span></font><font face="Courier New" size="2"><span
              style="font-size: 10pt; font-family: "Courier
              New";"><o:p></o:p></span></font></p>
        <p class="MsoNormal" style=""><font face="Courier New" size="2"><span
              style="font-size: 10pt; font-family: "Courier
              New";"><o:p> </o:p></span></font></p>
        <p class="MsoNormal" style=""><font color="black" face="Courier
            New" size="2"><span style="font-size: 10pt; font-family:
              "Courier New"; color: black;">               
            </span></font><b><font color="#7f0055" face="Courier New"
              size="2"><span style="font-size: 10pt; font-family:
                "Courier New"; color: rgb(127, 0, 85);
                font-weight: bold;">switch</span></font></b><font
            color="black" face="Courier New" size="2"><span
              style="font-size: 10pt; font-family: "Courier
              New"; color: black;"> (</span></font><font
            color="#0000c0" face="Courier New" size="2"><span
              style="font-size: 10pt; font-family: "Courier
              New"; color: rgb(0, 0, 192);">state</span></font><font
            color="black" face="Courier New" size="2"><span
              style="font-size: 10pt; font-family: "Courier
              New"; color: black;">) {</span></font><font
            face="Courier New" size="2"><span style="font-size: 10pt;
              font-family: "Courier New";"><o:p></o:p></span></font></p>
        <p class="MsoNormal" style=""><font color="black" face="Courier
            New" size="2"><span style="font-size: 10pt; font-family:
              "Courier New"; color: black;">                   
            </span></font><b><font color="#7f0055" face="Courier New"
              size="2"><span style="font-size: 10pt; font-family:
                "Courier New"; color: rgb(127, 0, 85);
                font-weight: bold;">case</span></font></b><font
            color="black" face="Courier New" size="2"><span
              style="font-size: 10pt; font-family: "Courier
              New"; color: black;"> 1: </span></font><font
            color="#3f7f5f" face="Courier New" size="2"><span
              style="font-size: 10pt; font-family: "Courier
              New"; color: rgb(63, 127, 95);">/* doConnect never
              returned */</span></font><font face="Courier New" size="2"><span
              style="font-size: 10pt; font-family: "Courier
              New";"><o:p></o:p></span></font></p>
        <p class="MsoNormal" style=""><font color="black" face="Courier
            New" size="2"><span style="font-size: 10pt; font-family:
              "Courier New"; color: black;">                       
            </span></font><font color="#0000c0" face="Courier New"
            size="2"><span style="font-size: 10pt; font-family:
              "Courier New"; color: rgb(0, 0, 192);">state</span></font><font
            color="black" face="Courier New" size="2"><span
              style="font-size: 10pt; font-family: "Courier
              New"; color: black;"> = 0;</span></font><font
            face="Courier New" size="2"><span style="font-size: 10pt;
              font-family: "Courier New";"><o:p></o:p></span></font></p>
        <p class="MsoNormal" style=""><font color="black" face="Courier
            New" size="2"><span style="font-size: 10pt; font-family:
              "Courier New"; color: black;">                       
            </span></font><font color="#0000c0" face="Courier New"
            size="2"><span style="font-size: 10pt; font-family:
              "Courier New"; color: rgb(0, 0, 192);">thread</span></font><font
            color="black" face="Courier New" size="2"><span
              style="font-size: 10pt; font-family: "Courier
              New"; color: black;">.interrupt();</span></font><font
            face="Courier New" size="2"><span style="font-size: 10pt;
              font-family: "Courier New";"><o:p></o:p></span></font></p>
        <p class="MsoNormal" style=""><font color="black" face="Courier
            New" size="2"><span style="font-size: 10pt; font-family:
              "Courier New"; color: black;">                       
            </span></font><font color="#0000c0" face="Courier New"
            size="2"><span style="font-size: 10pt; font-family:
              "Courier New"; color: rgb(0, 0, 192);">thread</span></font><font
            color="black" face="Courier New" size="2"><span
              style="font-size: 10pt; font-family: "Courier
              New"; color: black;"> = </span></font><b><font
              color="#7f0055" face="Courier New" size="2"><span
                style="font-size: 10pt; font-family: "Courier
                New"; color: rgb(127, 0, 85); font-weight: bold;">null</span></font></b><font
            color="black" face="Courier New" size="2"><span
              style="font-size: 10pt; font-family: "Courier
              New"; color: black;">;</span></font><font
            face="Courier New" size="2"><span style="font-size: 10pt;
              font-family: "Courier New";"><o:p></o:p></span></font></p>
        <p class="MsoNormal" style=""><font color="black" face="Courier
            New" size="2"><span style="font-size: 10pt; font-family:
              "Courier New"; color: black;">                       
            </span></font><b><font color="#7f0055" face="Courier New"
              size="2"><span style="font-size: 10pt; font-family:
                "Courier New"; color: rgb(127, 0, 85);
                font-weight: bold;">throw</span></font></b><font
            color="black" face="Courier New" size="2"><span
              style="font-size: 10pt; font-family: "Courier
              New"; color: black;">
            </span></font><b><font color="#7f0055" face="Courier New"
              size="2"><span style="font-size: 10pt; font-family:
                "Courier New"; color: rgb(127, 0, 85);
                font-weight: bold;">new</span></font></b><font
            color="black" face="Courier New" size="2"><span
              style="font-size: 10pt; font-family: "Courier
              New"; color: black;"> TransportException( </span></font><font
            color="#2a00ff" face="Courier New" size="2"><span
              style="font-size: 10pt; font-family: "Courier
              New"; color: rgb(42, 0, 255);">"Connection timeout"</span></font><font
            color="black" face="Courier New" size="2"><span
              style="font-size: 10pt; font-family: "Courier
              New"; color: black;"> );</span></font><font
            face="Courier New" size="2"><span style="font-size: 10pt;
              font-family: "Courier New";"><o:p></o:p></span></font></p>
        <p class="MsoNormal" style=""><font color="black" face="Courier
            New" size="2"><span style="font-size: 10pt; font-family:
              "Courier New"; color: black;">                   
            </span></font><b><font color="#7f0055" face="Courier New"
              size="2"><span style="font-size: 10pt; font-family:
                "Courier New"; color: rgb(127, 0, 85);
                font-weight: bold;">case</span></font></b><font
            color="black" face="Courier New" size="2"><span
              style="font-size: 10pt; font-family: "Courier
              New"; color: black;"> 2:</span></font><font
            face="Courier New" size="2"><span style="font-size: 10pt;
              font-family: "Courier New";"><o:p></o:p></span></font></p>
        <p class="MsoNormal" style=""><font color="black" face="Courier
            New" size="2"><span style="font-size: 10pt; font-family:
              "Courier New"; color: black;">                       
            </span></font><b><font color="#7f0055" face="Courier New"
              size="2"><span style="font-size: 10pt; font-family:
                "Courier New"; color: rgb(127, 0, 85);
                font-weight: bold;">if</span></font></b><font
            color="black" face="Courier New" size="2"><span
              style="font-size: 10pt; font-family: "Courier
              New"; color: black;"> (</span></font><font
            color="#0000c0" face="Courier New" size="2"><span
              style="font-size: 10pt; font-family: "Courier
              New"; color: rgb(0, 0, 192);">te</span></font><font
            color="black" face="Courier New" size="2"><span
              style="font-size: 10pt; font-family: "Courier
              New"; color: black;"> != </span></font><b><font
              color="#7f0055" face="Courier New" size="2"><span
                style="font-size: 10pt; font-family: "Courier
                New"; color: rgb(127, 0, 85); font-weight: bold;">null</span></font></b><font
            color="black" face="Courier New" size="2"><span
              style="font-size: 10pt; font-family: "Courier
              New"; color: black;">) { </span></font><font
            color="#3f7f5f" face="Courier New" size="2"><span
              style="font-size: 10pt; font-family: "Courier
              New"; color: rgb(63, 127, 95);">/* doConnect throw
              Exception */</span></font><font face="Courier New"
            size="2"><span style="font-size: 10pt; font-family:
              "Courier New";"><o:p></o:p></span></font></p>
        <p class="MsoNormal" style=""><font color="black" face="Courier
            New" size="2"><span style="font-size: 10pt; font-family:
              "Courier New"; color: black;">                           
            </span></font><font color="#0000c0" face="Courier New"
            size="2"><span style="font-size: 10pt; font-family:
              "Courier New"; color: rgb(0, 0, 192);">state</span></font><font
            color="black" face="Courier New" size="2"><span
              style="font-size: 10pt; font-family: "Courier
              New"; color: black;"> = 4;                        </span></font><font
            color="#3f7f5f" face="Courier New" size="2"><span
              style="font-size: 10pt; font-family: "Courier
              New"; color: rgb(63, 127, 95);">/* error */</span></font><font
            face="Courier New" size="2"><span style="font-size: 10pt;
              font-family: "Courier New";"><o:p></o:p></span></font></p>
        <p class="MsoNormal" style=""><font color="black" face="Courier
            New" size="2"><span style="font-size: 10pt; font-family:
              "Courier New"; color: black;">                           
            </span></font><font color="#0000c0" face="Courier New"
            size="2"><span style="font-size: 10pt; font-family:
              "Courier New"; color: rgb(0, 0, 192);">thread</span></font><font
            color="black" face="Courier New" size="2"><span
              style="font-size: 10pt; font-family: "Courier
              New"; color: black;"> = </span></font><b><font
              color="#7f0055" face="Courier New" size="2"><span
                style="font-size: 10pt; font-family: "Courier
                New"; color: rgb(127, 0, 85); font-weight: bold;">null</span></font></b><font
            color="black" face="Courier New" size="2"><span
              style="font-size: 10pt; font-family: "Courier
              New"; color: black;">;</span></font><font
            face="Courier New" size="2"><span style="font-size: 10pt;
              font-family: "Courier New";"><o:p></o:p></span></font></p>
        <p class="MsoNormal" style=""><font color="black" face="Courier
            New" size="2"><span style="font-size: 10pt; font-family:
              "Courier New"; color: black;">                           
            </span></font><b><font color="#7f0055" face="Courier New"
              size="2"><span style="font-size: 10pt; font-family:
                "Courier New"; color: rgb(127, 0, 85);
                font-weight: bold;">throw</span></font></b><font
            color="black" face="Courier New" size="2"><span
              style="font-size: 10pt; font-family: "Courier
              New"; color: black;">
            </span></font><font color="#0000c0" face="Courier New"
            size="2"><span style="font-size: 10pt; font-family:
              "Courier New"; color: rgb(0, 0, 192);">te</span></font><font
            color="black" face="Courier New" size="2"><span
              style="font-size: 10pt; font-family: "Courier
              New"; color: black;">;</span></font><font
            face="Courier New" size="2"><span style="font-size: 10pt;
              font-family: "Courier New";"><o:p></o:p></span></font></p>
        <p class="MsoNormal" style=""><font color="black" face="Courier
            New" size="2"><span style="font-size: 10pt; font-family:
              "Courier New"; color: black;">                       
              }</span></font><font face="Courier New" size="2"><span
              style="font-size: 10pt; font-family: "Courier
              New";"><o:p></o:p></span></font></p>
        <p class="MsoNormal" style=""><font color="black" face="Courier
            New" size="2"><span style="font-size: 10pt; font-family:
              "Courier New"; color: black;">                       
            </span></font><font color="#0000c0" face="Courier New"
            size="2"><span style="font-size: 10pt; font-family:
              "Courier New"; color: rgb(0, 0, 192);">state</span></font><font
            color="black" face="Courier New" size="2"><span
              style="font-size: 10pt; font-family: "Courier
              New"; color: black;"> = 3;                         </span></font><font
            color="#3f7f5f" face="Courier New" size="2"><span
              style="font-size: 10pt; font-family: "Courier
              New"; color: rgb(63, 127, 95);">/* Success! */</span></font><font
            face="Courier New" size="2"><span style="font-size: 10pt;
              font-family: "Courier New";"><o:p></o:p></span></font></p>
        <p class="MsoNormal" style=""><font color="black" face="Courier
            New" size="2"><span style="font-size: 10pt; font-family:
              "Courier New"; color: black;">                       
            </span></font><b><font color="#7f0055" face="Courier New"
              size="2"><span style="font-size: 10pt; font-family:
                "Courier New"; color: rgb(127, 0, 85);
                font-weight: bold;">return</span></font></b><font
            color="black" face="Courier New" size="2"><span
              style="font-size: 10pt; font-family: "Courier
              New"; color: black;">;</span></font><font
            face="Courier New" size="2"><span style="font-size: 10pt;
              font-family: "Courier New";"><o:p></o:p></span></font></p>
        <p class="MsoNormal" style=""><font color="black" face="Courier
            New" size="2"><span style="font-size: 10pt; font-family:
              "Courier New"; color: black;">                }</span></font><font
            face="Courier New" size="2"><span style="font-size: 10pt;
              font-family: "Courier New";"><o:p></o:p></span></font></p>
        <p class="MsoNormal"><font color="black" face="Courier New"
            size="2"><span style="font-size: 10pt; font-family:
              "Courier New"; color: black;">            }</span></font><font
            face="Arial" size="2"><span style="font-size: 10pt;
              font-family: Arial;"><o:p></o:p></span></font></p>
        <p class="MsoNormal"><font face="Arial" size="2"><span
              style="font-size: 10pt; font-family: Arial;"><o:p> </o:p></span></font></p>
        <p class="MsoNormal"><font face="Arial" size="2"><span
              style="font-size: 10pt; font-family: Arial;"><o:p> </o:p></span></font></p>
        <p class="MsoNormal" style="margin-left: 0.75in; text-indent:
          -0.25in;">
          <!--[if !supportLists]--><font face="Arial" size="2"><span
              style="font-size: 10pt; font-family: Arial;"><span
                style="">b)<font face="Times New Roman" size="1"><span
                    style="font: 7pt "Times New Roman";">      
                  </span></font></span></span></font><!--[endif]--><font
            face="Arial" size="2"><span style="font-size: 10pt;
              font-family: Arial;">add a cleanupThread() method to
              jcifs.util.transport.Transport, called from connect(long
              timeout) before creating the new thread, to check if the
              thread has already been initialized by a previous call to
              connect() and if so, interrupt and nullify it.<o:p></o:p></span></font></p>
        <p class="MsoNormal"><font face="Arial" size="2"><span
              style="font-size: 10pt; font-family: Arial;"><o:p> </o:p></span></font></p>
        <p class="MsoNormal" style="margin-left: 0.5in; text-indent:
          0.5in;">
          <font color="#0000c0" face="Courier New" size="2"><span
              style="font-size: 10pt; font-family: "Courier
              New"; color: rgb(0, 0, 192);">state</span></font><font
            color="black" face="Courier New" size="2"><span
              style="font-size: 10pt; font-family: "Courier
              New"; color: black;"> = 1;</span></font><font
            face="Courier New" size="2"><span style="font-size: 10pt;
              font-family: "Courier New";"><o:p></o:p></span></font></p>
        <p class="MsoNormal" style=""><font color="black" face="Courier
            New" size="2"><span style="font-size: 10pt; font-family:
              "Courier New"; color: black;">           
            </span></font><font color="#0000c0" face="Courier New"
            size="2"><span style="font-size: 10pt; font-family:
              "Courier New"; color: rgb(0, 0, 192);">te</span></font><font
            color="black" face="Courier New" size="2"><span
              style="font-size: 10pt; font-family: "Courier
              New"; color: black;"> = </span></font><b><font
              color="#7f0055" face="Courier New" size="2"><span
                style="font-size: 10pt; font-family: "Courier
                New"; color: rgb(127, 0, 85); font-weight: bold;">null</span></font></b><font
            color="black" face="Courier New" size="2"><span
              style="font-size: 10pt; font-family: "Courier
              New"; color: black;">;</span></font><font
            face="Courier New" size="2"><span style="font-size: 10pt;
              font-family: "Courier New";"><o:p></o:p></span></font></p>
        <p class="MsoNormal" style=""><font color="black" face="Courier
            New" size="2"><span style="font-size: 10pt; font-family:
              "Courier New"; color: black;">           
              <span style="background: none repeat scroll 0% 0% silver;">cleanupThread</span>();</span></font><font
            face="Courier New" size="2"><span style="font-size: 10pt;
              font-family: "Courier New";"><o:p></o:p></span></font></p>
        <p class="MsoNormal" style=""><font color="black" face="Courier
            New" size="2"><span style="font-size: 10pt; font-family:
              "Courier New"; color: black;">           
            </span></font><font color="#0000c0" face="Courier New"
            size="2"><span style="font-size: 10pt; font-family:
              "Courier New"; color: rgb(0, 0, 192);">thread</span></font><font
            color="black" face="Courier New" size="2"><span
              style="font-size: 10pt; font-family: "Courier
              New"; color: black;"> = </span></font><b><font
              color="#7f0055" face="Courier New" size="2"><span
                style="font-size: 10pt; font-family: "Courier
                New"; color: rgb(127, 0, 85); font-weight: bold;">new</span></font></b><font
            color="black" face="Courier New" size="2"><span
              style="font-size: 10pt; font-family: "Courier
              New"; color: black;"> Thread( </span></font><b><font
              color="#7f0055" face="Courier New" size="2"><span
                style="font-size: 10pt; font-family: "Courier
                New"; color: rgb(127, 0, 85); font-weight: bold;">this</span></font></b><font
            color="black" face="Courier New" size="2"><span
              style="font-size: 10pt; font-family: "Courier
              New"; color: black;">,
            </span></font><font color="#0000c0" face="Courier New"
            size="2"><span style="font-size: 10pt; font-family:
              "Courier New"; color: rgb(0, 0, 192);">name</span></font><font
            color="black" face="Courier New" size="2"><span
              style="font-size: 10pt; font-family: "Courier
              New"; color: black;"> + </span></font><font
            color="#2a00ff" face="Courier New" size="2"><span
              style="font-size: 10pt; font-family: "Courier
              New"; color: rgb(42, 0, 255);">"-"</span></font><font
            color="black" face="Courier New" size="2"><span
              style="font-size: 10pt; font-family: "Courier
              New"; color: black;"> + </span></font><i><font
              color="#0000c0" face="Courier New" size="2"><span
                style="font-size: 10pt; font-family: "Courier
                New"; color: rgb(0, 0, 192); font-style: italic;">threadId</span></font></i><font
            color="black" face="Courier New" size="2"><span
              style="font-size: 10pt; font-family: "Courier
              New"; color: black;">++ );</span></font><font
            face="Courier New" size="2"><span style="font-size: 10pt;
              font-family: "Courier New";"><o:p></o:p></span></font></p>
        <p class="MsoNormal" style="margin-left: 0.5in;"><font
            color="black" face="Courier New" size="2"><span
              style="font-size: 10pt; font-family: "Courier
              New"; color: black;">     
            </span></font><font color="#0000c0" face="Courier New"
            size="2"><span style="font-size: 10pt; font-family:
              "Courier New"; color: rgb(0, 0, 192);">thread</span></font><font
            color="black" face="Courier New" size="2"><span
              style="font-size: 10pt; font-family: "Courier
              New"; color: black;">.setDaemon(
            </span></font><b><font color="#7f0055" face="Courier New"
              size="2"><span style="font-size: 10pt; font-family:
                "Courier New"; color: rgb(127, 0, 85);
                font-weight: bold;">true</span></font></b><font
            color="black" face="Courier New" size="2"><span
              style="font-size: 10pt; font-family: "Courier
              New"; color: black;"> );</span></font><font
            face="Arial" size="2"><span style="font-size: 10pt;
              font-family: Arial;">
              <o:p></o:p></span></font></p>
        <p class="MsoNormal" style="margin-left: 0.5in;"><font
            face="Arial" size="2"><span style="font-size: 10pt;
              font-family: Arial;"><o:p> </o:p></span></font></p>
        <p class="MsoNormal" style="margin-left: 0.5in;"><font
            face="Arial" size="2"><span style="font-size: 10pt;
              font-family: Arial;"><o:p> </o:p></span></font></p>
        <p class="MsoNormal" style=""><font face="Arial" size="2"><span
              style="font-size: 10pt; font-family: Arial;">           
                         
            </span></font><b><font color="#7f0055" face="Courier New"
              size="2"><span style="font-size: 10pt; font-family:
                "Courier New"; color: rgb(127, 0, 85);
                font-weight: bold;">private</span></font></b><font
            color="black" face="Courier New" size="2"><span
              style="font-size: 10pt; font-family: "Courier
              New"; color: black;">
            </span></font><b><font color="#7f0055" face="Courier New"
              size="2"><span style="font-size: 10pt; font-family:
                "Courier New"; color: rgb(127, 0, 85);
                font-weight: bold;">void</span></font></b><font
            color="black" face="Courier New" size="2"><span
              style="font-size: 10pt; font-family: "Courier
              New"; color: black;"> cleanupThread()</span></font><font
            face="Courier New" size="2"><span style="font-size: 10pt;
              font-family: "Courier New";"><o:p></o:p></span></font></p>
        <p class="MsoNormal" style=""><font color="black" face="Courier
            New" size="2"><span style="font-size: 10pt; font-family:
              "Courier New"; color: black;">            {</span></font><font
            face="Courier New" size="2"><span style="font-size: 10pt;
              font-family: "Courier New";"><o:p></o:p></span></font></p>
        <p class="MsoNormal" style=""><font color="black" face="Courier
            New" size="2"><span style="font-size: 10pt; font-family:
              "Courier New"; color: black;">                 
            </span></font><b><font color="#7f0055" face="Courier New"
              size="2"><span style="font-size: 10pt; font-family:
                "Courier New"; color: rgb(127, 0, 85);
                font-weight: bold;">if</span></font></b><font
            color="black" face="Courier New" size="2"><span
              style="font-size: 10pt; font-family: "Courier
              New"; color: black;"> (</span></font><font
            color="#0000c0" face="Courier New" size="2"><span
              style="font-size: 10pt; font-family: "Courier
              New"; color: rgb(0, 0, 192);">thread</span></font><font
            color="black" face="Courier New" size="2"><span
              style="font-size: 10pt; font-family: "Courier
              New"; color: black;"> == </span></font><b><font
              color="#7f0055" face="Courier New" size="2"><span
                style="font-size: 10pt; font-family: "Courier
                New"; color: rgb(127, 0, 85); font-weight: bold;">null</span></font></b><font
            color="black" face="Courier New" size="2"><span
              style="font-size: 10pt; font-family: "Courier
              New"; color: black;">)</span></font><font
            face="Courier New" size="2"><span style="font-size: 10pt;
              font-family: "Courier New";"><o:p></o:p></span></font></p>
        <p class="MsoNormal" style=""><font color="black" face="Courier
            New" size="2"><span style="font-size: 10pt; font-family:
              "Courier New"; color: black;">                 
              {</span></font><font face="Courier New" size="2"><span
              style="font-size: 10pt; font-family: "Courier
              New";"><o:p></o:p></span></font></p>
        <p class="MsoNormal" style=""><font color="black" face="Courier
            New" size="2"><span style="font-size: 10pt; font-family:
              "Courier New"; color: black;">                 
                   
            </span></font><b><font color="#7f0055" face="Courier New"
              size="2"><span style="font-size: 10pt; font-family:
                "Courier New"; color: rgb(127, 0, 85);
                font-weight: bold;">return</span></font></b><font
            color="black" face="Courier New" size="2"><span
              style="font-size: 10pt; font-family: "Courier
              New"; color: black;">;</span></font><font
            face="Courier New" size="2"><span style="font-size: 10pt;
              font-family: "Courier New";"><o:p></o:p></span></font></p>
        <p class="MsoNormal" style=""><font color="black" face="Courier
            New" size="2"><span style="font-size: 10pt; font-family:
              "Courier New"; color: black;">                 
              }
            </span></font><font face="Courier New" size="2"><span
              style="font-size: 10pt; font-family: "Courier
              New";"><o:p></o:p></span></font></p>
        <p class="MsoNormal" style=""><font face="Courier New" size="2"><span
              style="font-size: 10pt; font-family: "Courier
              New";"><o:p> </o:p></span></font></p>
        <p class="MsoNormal" style=""><font color="black" face="Courier
            New" size="2"><span style="font-size: 10pt; font-family:
              "Courier New"; color: black;">                 
            </span></font><b><font color="#7f0055" face="Courier New"
              size="2"><span style="font-size: 10pt; font-family:
                "Courier New"; color: rgb(127, 0, 85);
                font-weight: bold;">if</span></font></b><font
            color="black" face="Courier New" size="2"><span
              style="font-size: 10pt; font-family: "Courier
              New"; color: black;"> (</span></font><font
            color="#0000c0" face="Courier New" size="2"><span
              style="font-size: 10pt; font-family: "Courier
              New"; color: rgb(0, 0, 192);">thread</span></font><font
            color="black" face="Courier New" size="2"><span
              style="font-size: 10pt; font-family: "Courier
              New"; color: black;">.isAlive())</span></font><font
            face="Courier New" size="2"><span style="font-size: 10pt;
              font-family: "Courier New";"><o:p></o:p></span></font></p>
        <p class="MsoNormal" style=""><font color="black" face="Courier
            New" size="2"><span style="font-size: 10pt; font-family:
              "Courier New"; color: black;">                 
              {</span></font><font face="Courier New" size="2"><span
              style="font-size: 10pt; font-family: "Courier
              New";"><o:p></o:p></span></font></p>
        <p class="MsoNormal" style=""><font color="black" face="Courier
            New" size="2"><span style="font-size: 10pt; font-family:
              "Courier New"; color: black;">                 
                   
            </span></font><font color="#0000c0" face="Courier New"
            size="2"><span style="font-size: 10pt; font-family:
              "Courier New"; color: rgb(0, 0, 192);">thread</span></font><font
            color="black" face="Courier New" size="2"><span
              style="font-size: 10pt; font-family: "Courier
              New"; color: black;">.interrupt();</span></font><font
            face="Courier New" size="2"><span style="font-size: 10pt;
              font-family: "Courier New";"><o:p></o:p></span></font></p>
        <p class="MsoNormal" style=""><font color="black" face="Courier
            New" size="2"><span style="font-size: 10pt; font-family:
              "Courier New"; color: black;">                 
              }</span></font><font face="Courier New" size="2"><span
              style="font-size: 10pt; font-family: "Courier
              New";"><o:p></o:p></span></font></p>
        <p class="MsoNormal" style=""><font color="black" face="Courier
            New" size="2"><span style="font-size: 10pt; font-family:
              "Courier New"; color: black;">                 
            </span></font><font color="#0000c0" face="Courier New"
            size="2"><span style="font-size: 10pt; font-family:
              "Courier New"; color: rgb(0, 0, 192);">thread</span></font><font
            color="black" face="Courier New" size="2"><span
              style="font-size: 10pt; font-family: "Courier
              New"; color: black;"> = </span></font><b><font
              color="#7f0055" face="Courier New" size="2"><span
                style="font-size: 10pt; font-family: "Courier
                New"; color: rgb(127, 0, 85); font-weight: bold;">null</span></font></b><font
            color="black" face="Courier New" size="2"><span
              style="font-size: 10pt; font-family: "Courier
              New"; color: black;">;</span></font><font
            face="Courier New" size="2"><span style="font-size: 10pt;
              font-family: "Courier New";"><o:p></o:p></span></font></p>
        <p class="MsoNormal" style="margin-left: 0.5in;"><font
            color="black" face="Courier New" size="2"><span
              style="font-size: 10pt; font-family: "Courier
              New"; color: black;">      }</span></font><font
            face="Arial" size="2"><span style="font-size: 10pt;
              font-family: Arial;"><o:p></o:p></span></font></p>
        <p class="MsoNormal"><font face="Arial" size="2"><span
              style="font-size: 10pt; font-family: Arial;"><o:p> </o:p></span></font></p>
        <p class="MsoNormal"><font face="Arial" size="2"><span
              style="font-size: 10pt; font-family: Arial;">These two
              changes seem redundant to me, and a bit dangerous (I’d
              prefer not to blindly interrupt a thread in progress), but
              without knowing how to reproduce the problem to test, I’m
              forced to take my predecessor’s word for it (and the fact
              that the customer’s ticket was closed) that it worked.
              <o:p></o:p></span></font></p>
        <p class="MsoNormal"><font face="Arial" size="2"><span
              style="font-size: 10pt; font-family: Arial;"><o:p> </o:p></span></font></p>
        <p class="MsoNormal"><font face="Arial" size="2"><span
              style="font-size: 10pt; font-family: Arial;">I don’t
              necessarily expect these changes to be included in a
              future release because of the vagueness of the problem,
              but if anyone has seen a similar thread accumulation, you
              could try making these same changes (one or the other or
              both), and if it helps, maybe you could share a thread
              dump of the situation prior to the change, so it can be
              properly documented as to what the problem is (i.e. what
              the threads end up blocked on). If the problem can be
              properly identified and reproduced, and the solution
              proven to be effective, it might make a good addition to a
              future release (whenever that might be).<o:p></o:p></span></font></p>
        <p class="MsoNormal"><font face="Arial" size="2"><span
              style="font-size: 10pt; font-family: Arial;"><o:p> </o:p></span></font></p>
        <p class="MsoNormal"><font face="Arial" size="2"><span
              style="font-size: 10pt; font-family: Arial;"><o:p> </o:p></span></font></p>
        <p class="MsoNormal"><font face="Arial" size="2"><span
              style="font-size: 10pt; font-family: Arial;">Cheers,<o:p></o:p></span></font></p>
        <p class="MsoNormal"><font face="Arial" size="2"><span
              style="font-size: 10pt; font-family: Arial;"><o:p> </o:p></span></font></p>
        <p class="MsoNormal"><font face="Arial" size="2"><span
              style="font-size: 10pt; font-family: Arial;">Colin<o:p></o:p></span></font></p>
        <p class="MsoNormal"><font face="Times New Roman" size="3"><span
              style="font-size: 12pt;"><o:p> </o:p></span></font></p>
      </div>
    </blockquote>
    <br>
  </body>
</html>