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

vm crashes instead of throwing OutOfMemoryError when allocating many objects.

    XMLWordPrintable

    Details

      Description



      Name: krT82822 Date: 04/23/99


      This happend in both 1.1.8 and Classic VM 1.2.1-A (native threads)

      The following simple program crashes jit-enabled JavaVM
      (this doens't happend with nojit option).
      instead of throwing OutOfMemoryException.

      ----------------------------
      public class Test
         public static void main(String a[]) {
             java.util.Vector v = new java.util.Vector();
             while(true) {
                 v.addElement(Integer.toString(0));
             }
         }
      }
      ----------------------------
      > java -version
      java version "1.1.8"
      > java -verbosegc -mx8m -ms8m Test
      <GC: need to expand mark bits to cover 262144 bytes>
      <GC: managing allocation failure: need 8 bytes, type=2, action=1>
      <GC: 0 milliseconds since last GC>
      <GC: freeing class java.lang.Compiler>
      <GC: unloaded and freed 1 class>
      <GC: freed 2789 objects, 694648 bytes in 112 ms, 51% free (3468512/6710880)>
        <GC: init&scan: 2 ms, scan handles: 94 ms, sweep: 16 ms, compact: 0 ms>
      <GC: managing allocation failure: need 8 bytes, type=2, action=2>
      <GC: 110 milliseconds since last GC>
      <GC: managing allocation failure: need 8 bytes, type=2, action=3>
      <GC: 0 milliseconds since last GC>
      <GC: managing allocation failure: need 8 bytes, type=2, action=4>
      <GC: 20 milliseconds since last GC>
      <GC: managing allocation failure: need 8 bytes, type=2, action=1>
      <GC: 0 milliseconds since last GC>
      <GC: freed 33 objects, 992 bytes in 111 ms, 51% free (3435440/6710880)>
        <GC: init&scan: 1 ms, scan handles: 94 ms, sweep: 16 ms, compact: 0 ms>
      <GC: managing allocation failure: need 8 bytes, type=2, action=2>
      <GC: 120 milliseconds since last GC>
      <GC: managing allocation failure: need 8 bytes, type=2, action=3>
      <GC: 0 milliseconds since last GC>
      <GC: managing allocation failure: need 8 bytes, type=2, action=4>
      <GC: 10 milliseconds since last GC>
      <GC: managing allocation failure: need 8 bytes, type=2, action=1>
      <GC: 0 milliseconds since last GC>
      <GC: freed 1 objects, 656 bytes in 113 ms, 51% free (3435056/6710880)>
        <GC: init&scan: 1 ms, scan handles: 96 ms, sweep: 16 ms, compact: 0 ms>
      <GC: managing allocation failure: need 8 bytes, type=2, action=2>
      <GC: 120 milliseconds since last GC>
      <GC: managing allocation failure: need 8 bytes, type=2, action=3>
      <GC: 0 milliseconds since last GC>
      <GC: managing allocation failure: need 8 bytes, type=2, action=4>
      <GC: 10 milliseconds since last GC>
      <GC: managing allocation failure: need 1032 bytes, type=2, action=1>
      <GC: 0 milliseconds since last GC>
      <GC: compactHeap took 209 ms, blocks_moved=0x33d4e>
      <GC: last free block at 0x00E395D4 of length 3435048>
      <GC: last free block is at end>
      <GC: freed 0 objects, 0 bytes in 321 ms, 51% free (3435048/6710880)>
        <GC: init&scan: 1 ms, scan handles: 95 ms, sweep: 15 ms, compact: 210 ms>
      <GC: managing allocation failure: need 1032 bytes, type=2, action=2>
      <GC: 321 milliseconds since last GC>
      <GC: managing allocation failure: need 1032 bytes, type=2, action=3>
      <GC: 10 milliseconds since last GC>
      <GC: managing allocation failure: need 1032 bytes, type=2, action=4>
      <GC: 10 milliseconds since last GC>
      <GC: run out of handle space>
      <GC: managing allocation failure: need 1032 bytes, type=2, action=5>
      <GC: 0 milliseconds since last GC>
      <GC: totally out of heap space>
      <GC: managing allocation failure: need 16 bytes, type=2, action=1>
      <GC: 20 milliseconds since last GC>
      <GC: compactHeap took 147 ms, blocks_moved=0x1>
      <GC: last free block at 0x00E395D4 of length 3435048>
      <GC: last free block is at end>
      <GC: freed 0 objects, 0 bytes in 262 ms, 51% free (3435048/6710880)>
        <GC: init&scan: 1 ms, scan handles: 97 ms, sweep: 17 ms, compact: 147 ms>
      <GC: managing allocation failure: need 16 bytes, type=2, action=2>
      <GC: 270 milliseconds since last GC>
      <GC: managing allocation failure: need 16 bytes, type=2, action=3>
      <GC: 0 milliseconds since last GC>
      <GC: managing allocation failure: need 16 bytes, type=2, action=4>
      <GC: 10 milliseconds since last GC>
      <GC: run out of handle space>
      <GC: managing allocation failure: need 16 bytes, type=2, action=5>
      <GC: 0 milliseconds since last GC>
      <GC: totally out of heap space>
      <GC: managing allocation failure: need 1032 bytes, type=2, action=1>
      <GC: 20 milliseconds since last GC>
      <GC: compactHeap took 140 ms, blocks_moved=0x1>
      <GC: last free block at 0x00E395D4 of length 3435048>
      <GC: last free block is at end>
      <GC: freed 0 objects, 0 bytes in 252 ms, 51% free (3435048/6710880)>
        <GC: init&scan: 1 ms, scan handles: 95 ms, sweep: 16 ms, compact: 140 ms>
      <GC: managing allocation failure: need 1032 bytes, type=2, action=2>
      <GC: 261 milliseconds since last GC>
      <GC: managing allocation failure: need 1032 bytes, type=2, action=3>
      <GC: 0 milliseconds since last GC>
      <GC: managing allocation failure: need 1032 bytes, type=2, action=4>
      <GC: 10 milliseconds since last GC>
      <GC: run out of handle space>
      <GC: managing allocation failure: need 1032 bytes, type=2, action=5>
      <GC: 0 milliseconds since last GC>
      <GC: totally out of heap space>
      <GC: managing allocation failure: need 16 bytes, type=2, action=1>
      <GC: 20 milliseconds since last GC>
      <GC: compactHeap took 141 ms, blocks_moved=0x1>
      <GC: last free block at 0x00E395D4 of length 3435048>
      <GC: last free block is at end>
      <GC: freed 0 objects, 0 bytes in 252 ms, 51% free (3435048/6710880)>
        <GC: init&scan: 1 ms, scan handles: 94 ms, sweep: 16 ms, compact: 141 ms>
      <GC: managing allocation failure: need 16 bytes, type=2, action=2>
      <GC: 260 milliseconds since last GC>
      <GC: managing allocation failure: need 16 bytes, type=2, action=3>
      <GC: 0 milliseconds since last GC>
      <GC: managing allocation failure: need 16 bytes, type=2, action=4>
      <GC: 10 milliseconds since last GC>
      <GC: run out of handle space>
      <GC: managing allocation failure: need 16 bytes, type=2, action=5>
      <GC: 0 milliseconds since last GC>
      <GC: totally out of heap space>

      [ and dialog pops up saying
      The instruction at "0x..." referenced memory at "0x..."
      The memory could not be "read"]

      ---------------------
      According to debugger, it is crashing in the SYMCJIT.dll.

      It throws an Exception when I replace "Integer.toString(0)" with
      something like "new String(..)". Accoring to the symptom that
      it worked when I copied the exactly same code from Integer.java.
      I guess the jit has replaced this java library with native library
      written in C/C++ which cause this problem.
      (Review ID: 57420)
      ======================================================================

        Attachments

          Activity

            People

            Assignee:
            duke J. Duke (Inactive)
            Reporter:
            kryansunw Kevin Ryan (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: