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

java_g Fatal: memory stomping error

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      beta
    • CPU:
      x86
    • OS:
      windows_nt
    • Verification:
      Verified

      Description



      Name: szC45993 Date: 11/24/99



       /net/sqesvr/vsn/testbase/testbase_nsk/src/nsk/arguments/args00122 test,
      which uses developing options, crashes java_g (java version "1.3beta"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.3beta-O)
      Java HotSpot(TM) Client VM (build 1.3-P, mixed mode))
      on WinNT (Pentium II, 350MHz, 128Mb RAM, Windows NT 4.0 Workstation).
      See log and source below.

      LOG:
      ====

      ------------------------------- FIRST RUN ---------------------------------

      [#] f:/ld24/java/zss/_BOX_for_SAVING/_TMP/_/jdk1.3O/bin/java -version
      java version "1.3beta"
      Java(TM) 2 Runtime Environment, Standard Edition (build 1.3beta-O)
      Java HotSpot(TM) Client VM (build 1.3-P, mixed mode)
      [#] f:/ld24/java/zss/_BOX_for_SAVING/_TMP/_/jdk1.3O/bin/java -XX:Flags=f:/ld24/java/zss/TONGA_WSs/testbase_js/src/nsk/arguments/args00122/gammarc.gammarc -verify args0122
      VM option '+PrintVMMessages'
      VM option '+PromptForDebug'
      VM option '+TraceVMOperation'
      VM option '+PrintCompilation'
      VM option '+PrintAssembly'
      VM option '+PrintNMethods'
      VM option '+PrintNativeNMethods'
      VM option '+PrintCodeCache'
      VM option '+PrintCodeCache2'
      VM option '+DumpEventsAtError'
      VM option '+PrintStubCode'
      VM option '+ProfilerPrintByteCodeStatistics'
      VM option '+ProfilerRecordPC'
      VM option '+ProfilerCheckIntervals'
      VM option '+PrintJVMWarnings'

      ...

      #
      # HotSpot Virtual Machine Error, Internal Error
      #
      # Fatal: memory stomping error
      #
      # Error ID: C:/hotspot\src\share\vm\runtime\os.cpp, 395
      #
      [#]


      SOURCES:
      ========

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



      #--------------------- gammarc.gammarc:
      +PrintVMMessages
      +PromptForDebug
      +TraceVMOperation
      +PrintCompilation
      +PrintAssembly
      +PrintNMethods
      +PrintNativeNMethods
      +PrintCodeCache
      +PrintCodeCache2
      +DumpEventsAtError
      +PrintStubCode
      +ProfilerPrintByteCodeStatistics
      +ProfilerRecordPC
      +ProfilerCheckIntervals
      +PrintJVMWarnings
      #---------------------


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

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              lbaksunw Lars Bak (Inactive)
              Reporter:
              zsssunw Zss Zss (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: