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

Severe performance degradation of java webserver under JRE1.1.2

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P1 P1
    • 1.1.2
    • 1.1.2
    • core-libs
    • None
    • b01
    • sparc
    • solaris_2.5
    • Not verified

      A severe performance degradation occurs in ServerSockets when running the 1.1.2 version of the JRE under Solaris 5.5 and 5.5.1, and using the ServerSocket.setSoTimeout(int) feature.

      The following code snip will expose the problem:

      import java.net.*;
      import java.io.*;

      class SST implements Runnable {

          static void p(String s) {
      System.out.println(s);
          }

          public static void main(String[] a) throws Exception {

      ServerSocket ss = new ServerSocket(3456);
      ss.setSoTimeout(40000);
      while (true) {
      p("enter accept:");
      Socket s = ss.accept();

      p("accepted " +s);

      Thread t = new Thread(new SST(s), "reader");
      t.start();
      }
          }

          SST(Socket s) {
      this.s = s;
          }

          Socket s;

          public void run() {

      try {
      InputStream i = s.getInputStream();

      int r;
      while ((r = i.read()) > 0) {
      System.out.write(r);
      }
      } catch (Exception e) {
      e.printStackTrace();
      }
          }


      }

            djbrown David Brown (Inactive)
            duke J. Duke
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: