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

HotSpot Virtual Machine Error, Unexpected exception occured

XMLWordPrintable

    • x86
    • windows_nt



      Name: szC45993 Date: 01/15/99



      The Tonga/src/nsk/thread/thread00103 test discovers the HotSpot VM (1.0beta1, core version, release build Jan 13 1999 12:43:10) error:

      export CLASSPATH=".;c:\\zss\\classes_my"
      cd C:/zss/TONGA_WSs/testbase_js/src/nsk/thread/thread00103
      h:/ld25/java/dest/jdk1.1.6/win32/bin/javac.exe -d c:/zss/classes_my thread00103.java
      c:/jdk1.2/bin/java -Xmixed -XX:+TraceLocking -XX:+LogMutexLocking -XX:+LogMultipleMutexLocking -XX:+LogEvents -verify thread00103
      #
      # HotSpot Virtual Machine Error, Unexpected exception occured
      #
      # EXCEPTION_ACCESS_VIOLATION#
      [1] + Done(134) c:/jdk1.2/bin/java -Xmixed -XX:Flags=C:/zss/TONGA_WSs/testbase_js/src/nsk/thread/thread00103/gammarc.gammarc -verify thread00103
        94 Abort c:/jdk1.2/bin/java
      $

      SOURCES:

      //--------------------- thread00103.java:

      //thread00103.java
      /* This test simply creates a series of circularly
       * linked memeory objects which should be able to be
       * GC'd
       */
      import java.io.PrintStream;

      class MemoryObject
      {
          byte array[];
          MemoryObject next;
          MemoryObject previous;

          public MemoryObject(int size)
          {
              array = new byte[size];
          }
      }

      class thread00103
      {
          static final int ARRAY_SIZE = 100;
          static final int OBJECT_SIZE = 10;
          static final int LOOP_COUNT = 5;
          static final int CIRCULARITY_SIZE = 3;

          static MemoryObject memoryArray[] = new MemoryObject[ARRAY_SIZE];

      public static void main(String argv[]) {
      System.exit(run(argv, System.out) + 95/*STATUS_TEMP*/);
      }

          public static int run(String argv[],PrintStream out)
          {
              for (int j = 0; j < LOOP_COUNT; j++)
              {
                  System.out.println(j + ": " + Runtime.getRuntime().freeMemory());
                  for (int i = 0; i < ARRAY_SIZE; i ++)
                  {
                      memoryArray[i] = new MemoryObject(OBJECT_SIZE);
                      makeCircular(memoryArray[i], CIRCULARITY_SIZE);
                  }
              }

              // if there's any memory left, let's assume it's okay
              System.out.println("Test passed.");
      return 0;

          }

          public static void makeCircular(MemoryObject mObj, int depth)
          {
      MemoryObject tmpObj = mObj;

              for (int i = 0; i < depth; i++)
              {
                  tmpObj.next = new MemoryObject(OBJECT_SIZE);
                  tmpObj= tmpObj.next;
              }
      tmpObj.next = mObj;
          }

          public static void confirmCircular(MemoryObject mObj)
          {
      int count = 0;
      MemoryObject mObj2 = mObj;
      while (mObj2.next != mObj)
      {
      count++;
      mObj2 = mObj2.next;
      }
      System.out.println("Circularity level: " + count);
          }
      }
      //---------------------

      ======================================================================

            Unassigned Unassigned
            zsssunw Zss Zss (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: