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

InitialCodeCacheSize value changing leads to java_g internal errors

    XMLWordPrintable

    Details

    • Subcomponent:
    • CPU:
      x86
    • OS:
      windows_nt

      Description



      Name: szC45993 Date: 08/05/99



      First,
      java_g (HotSpot VM 1.0.1, mixed mode, debug build d) on WinNT
      (Pentium II, 350MHz, 128Mb RAM, Windows NT 4.0 Workstation)
      demands big amount of initial CodeCache size (about 9000K
      when for other releases, for example, HotSpot Client VM 1.3beta, mixed mode, debug build l, 160K value is sufficient).

      Second, when InitialCodeCacheSize value becomes sufficient other error
      (Fatal: out of space in code cache) is arisen.

      See log and sources below.

      [#] f:/ld25/java/dest/jdk1.3L/win32/bin/java_g -version
      java version "1.3"
      HotSpot Client VM (1.3beta, mixed mode, debug build l)
      [Verifying threads permgen oldgen ct newgen rset syms strs lkup zone dict hand C-heap ]
      [#] f:/ld25/java/dest/jdk1.3L/win32/bin/java_g -verify -XX:Flags=f:/ld24/java/zss/TONGA_WSs/testbase_js/src/nsk/arguments/args00133/gammarc.gammarc args00133
      VM option 'InitialCodeCacheSize=160'
      VM option 'ReservedCodeCacheSize=160*K'
      0: 1344704
      1: 1324776
      2: 1305168
      3: 1285560
      4: 1265952
      Test passed.
      [Verifying threads permgen oldgen ct newgen rset syms strs lkup zone dict hand C-heap ]


      [#] d:/from_C/jdk1.2.2W-hs1.0.1betaD/bin/java_g -version
      java version "1.2.2"
      HotSpot VM (1.0.1, mixed mode, debug build d)
      [Verifying threads permgen oldgen ct newgen rset syms lkup zone dict hand C-heap ]
      [#]
      [#] d:/from_C/jdk1.2.2W-hs1.0.1betaD/bin/java_g -verify -XX:Flags=f:/ld24/java/zss/TONGA_WSs/testbase_js/src/nsk/arguments/args00133/gammarc.gammarc args00133

      VM option 'InitialCodeCacheSize=8000'
      VM option 'ReservedCodeCacheSize=10000*K'
      #
      # HotSpot Virtual Machine Error, Internal Error
      #
      # Fatal: Initial size of CodeCache is too small
      #
      # Error ID: C:/hotspot\src\share\vm\code\codeBlob.cpp, 157
      #
      [#] d:/from_C/jdk1.2.2W-hs1.0.1betaD/bin/java_g -verify -XX:Flags=f:/ld24/java/zss/TONGA_WSs/testbase_js/src/nsk/arguments/args00133/gammarc.gammarc args00133
      VM option 'InitialCodeCacheSize=9000'
      VM option 'ReservedCodeCacheSize=10000*K'
      HotSpot VM warning: CodeCache is full. Compiler has been disabled
      #
      # HotSpot Virtual Machine Error, Internal Error
      #
      # Fatal: out of space in code cache
      #
      # Error happened during: compile I2C
      #
      # Error ID: C:/hotspot\src\share\vm\code\adapters.cpp, 308
      #
      [#]


      SOURCE:
      ========

      //--------------------- args00133.java:
      //args00133.java
      /* This test simply creates a series of circularly
       * linked memeory objects which should be able to be
       * GC'd
       */


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

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

      class args00133
      {
          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 args[])
          {
              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.");

          }

          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);
          }
      }
      //---------------------

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

        Attachments

          Activity

            People

            Assignee:
            rschmidtsunw Rene Schmidt (Inactive)
            Reporter:
            zsssunw Zss Zss (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: