Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-5009359

JMXMP: thread leak on the client side

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P2
    • Resolution: Fixed
    • Affects Version/s: 1.0.1
    • Fix Version/s: 1.0.1
    • Component/s: core-svc
    • Labels:
      None
    • Subcomponent:
    • Resolved In Build:
      1.0.1
    • CPU:
      sparc
    • OS:
      generic

      Description

       <###@###.###>

      I have now got a thread leak on the client side. It occurs with Remoting 1.0.1, JDMK 5.1 but *NOT* with Remoting 1.0.

      The problem is when the client tries to connect to a server that is not there! The client gets a connection exception, but then leaks a thread.

      It is a simple reproduce (attached java source file). I have also attached the output from my running it. You can see that there are many JobExecutor threads.

      Is this a known problem? Should I raise a Bugtraq defect.

      Steve




      import javax.management.remote.JMXServiceURL;
      import javax.management.remote.JMXConnector;
      import javax.management.remote.JMXConnectorFactory;

      import java.net.ConnectException;
      import java.util.Collections;

      public class Main {
          public static void main(String[] args) throws Exception {
      JMXServiceURL url;
      if (args.length == 0) {
      url = new JMXServiceURL("service:jmx:jmxmp://localhost:5555");
      } else {
      url = new JMXServiceURL(args[0]);
      }

      message1();

      for (int i = 0; i < 2000; i++) {
      JMXConnector jmxc = JMXConnectorFactory.newJMXConnector(url,
      Collections.EMPTY_MAP);
      try {
      jmxc.connect();
      message2();
      System.exit(-1);
      } catch (ConnectException e) {
      System.out.print("c");
      } finally {
      jmxc.close();
      }
      }
          }

          private static void message1() {
      System.out.println("Wait for a few characters to be displayed,\nthen get a list of the running threads. On my Solaris machine this is <ctrl>+\\");
          }

          private static void message2() {
      System.err.println("Connection Succeeded\nPlease try the test and get the connection to fail");
          }
      }



      Wait for a few characters to be displayed,
      then get a list of the running threads. On my Solaris machine this is <ctrl>+ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccFull thread dump Java HotSpot(TM) Client VM (1.4.2_03-b02 mixed mode):

      "Job_Executor80" daemon prio=5 tid=0x002b3dc8 nid=0x59 in Object.wait() [ec97f000..ec97fc30]
      at java.lang.Object.wait(Native Method)
      - waiting on <0xf19f6650> (a [I)
      at java.lang.Object.wait(Object.java:429)
      at com.sun.jmx.remote.opt.util.ThreadService$ThreadServiceJob.run(ThreadService.java:183)
      - locked <0xf19f6650> (a [I)
      at com.sun.jmx.remote.opt.util.JobExecutor.run(JobExecutor.java:59)

      "Job_Executor79" daemon prio=5 tid=0x002b3318 nid=0x58 in Object.wait() [eca7f000..eca7fc30]
      at java.lang.Object.wait(Native Method)
      - waiting on <0xf19ecdd8> (a [I)
      at java.lang.Object.wait(Object.java:429)
      at com.sun.jmx.remote.opt.util.ThreadService$ThreadServiceJob.run(ThreadService.java:183)
      - locked <0xf19ecdd8> (a [I)
      at com.sun.jmx.remote.opt.util.JobExecutor.run(JobExecutor.java:59)

      "Job_Executor78" daemon prio=5 tid=0x002b2868 nid=0x57 in Object.wait() [ecb7f000..ecb7fc30]
      at java.lang.Object.wait(Native Method)
      - waiting on <0xf19e3560> (a [I)
      at java.lang.Object.wait(Object.java:429)
      at com.sun.jmx.remote.opt.util.ThreadService$ThreadServiceJob.run(ThreadService.java:183)
      - locked <0xf19e3560> (a [I)
      at com.sun.jmx.remote.opt.util.JobExecutor.run(JobExecutor.java:59)

      "Job_Executor77" daemon prio=5 tid=0x002b1db8 nid=0x56 in Object.wait() [ecc7f000..ecc7fc30]
      at java.lang.Object.wait(Native Method)
      - waiting on <0xf19d9ce8> (a [I)
      at java.lang.Object.wait(Object.java:429)
      at com.sun.jmx.remote.opt.util.ThreadService$ThreadServiceJob.run(ThreadService.java:183)
      - locked <0xf19d9ce8> (a [I)
      at com.sun.jmx.remote.opt.util.JobExecutor.run(JobExecutor.java:59)

      ...

        Attachments

          Activity

            People

            • Assignee:
              sjiang Shanliang Jiang (Inactive)
              Reporter:
              sjiang Shanliang Jiang (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Imported:
                Indexed: