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

Server VM much slower than Client VM in JDK 1.3.1 and 1.4.0-beta

    Details

    • Subcomponent:
    • Resolved In Build:
      04
    • CPU:
      generic, sparc
    • OS:
      generic, solaris_8

      Description



      Name: rmT116609 Date: 08/09/2001


      java version "1.3.1"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1-b24)
      Java HotSpot(TM) Client VM (build 1.3.1-b24, mixed mode)

      ---

      uname -a:
      SunOS puw03 5.8 Generic_108528-06 sun4u sparc


      I encountered a big performance problem using 1.3.1-Server-VM in the following case:

      Requirements:
      - Oracle-JDBC 8.1.7
      - a table containing two NUMBER column - 50000 rows

      Executing the following class takes about 16-18 seconds with server VM (java - server) and about 1.3 seconds with client VM (java -hotspot).

      Java class:

      import java.sql.*;
      import oracle.sql.*;
      import oracle.jdbc.driver.*;
      public class Test {
        public static void main(String[] args) throws Throwable {
          Class.forName("oracle.jdbc.driver.OracleDriver");
          Connection conn=DriverManager.getConnection("jdbc:oracle:thin:@127.0.0.1:1521:orcl","user","password");
          PreparedStatement pstmt=conn.prepareStatement("SELECT the_column from the_table");
          OracleResultSet rset=(OracleResultSet)pstmt.executeQuery();
          rset.setFetchSize(500);
          long t0=System.currentTimeMillis();
          int n=0;
          for (;rset.next();n++)
            rset.getNUMBER(1).longValue(); // somewhat faster than rset.getLong(1);
          System.out.println(""+n+" "+(System.currentTimeMillis()-t0));
          rset.close();
          pstmt.close();
        }
      }


      I verified the behaviour against 1.4.0-beta. Here's the output of a little test, which performs the test againt 1.4-client-VM,
      1.4-server-VM, 1.3.1-client-VM, 1.3.1-server-VM. It's the same Java code, I provided in the bug report.

      Java HotSpot(TM) Client VM
      1.4.0-beta-b65
      70041 rows in 11027ms

      Java HotSpot(TM) Server VM
      1.4.0-beta-b65
      70041 rows in 41341ms

      Java HotSpot(TM) Client VM
      1.3.1-b24
      70041 rows in 10578ms

      Java HotSpot(TM) Server VM
      1.3.1-b24
      70041 rows in 39404ms

      Means, that the bug still exists in 1.4.0-beta.

      Sorry, I cannot give you the database table I've used for the tests. But I can give you a little SQL script,
      that will create a table like the one I'm using and the JDBC driver (classes12.zip). I'm using Oracle 8.1.7.2.

      Please see the attachments for classes12.zip



      SQL-script to be executed in sqlplus:
      -------------------------------------
      CREATE TABLE test (anumber number );
      CREATE SEQUENCE testseq BEGIN WITH 1 INCREMENT BY 1;
      begin
      for i in 1 .. 70041 loop
      insert into test values (testseq.nextval);
      end loop;
      commit;
      end;
      /

      (Review ID: 127933)
      ======================================================================

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                xjiangsunw Xuyang Jiang (Inactive)
                Reporter:
                rmandalasunw Ranjith Mandala (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: