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

pointer_delta not used for pointer diff

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P2 P2
    • 6
    • 5.0, 5.0u6
    • hotspot
    • gc
    • 1.4.1
    • b37
    • generic, sparc
    • generic, solaris_10

        In psMarkSweepDecorator.cpp, the difference between two pointers is taken without using pointer_delta. This caused a crash when the size of the Java heap was greater than 2 Gb and operating in 32-bit mode. With a debug build, there is an assertion failure that says: "deadspace too big for Arrayoop".

        #ifdef HP
                size_t sz = pointer_delta(end, q, sizeof(HeapWord*));
        #else
                size_t sz = end - q;
        #endif

        java -Xms2000m -Xmx3400m -Xmn400m -XX:+UseParallelGC MaxOutMemory

        import java.util.*;

        public class MaxOutMemory {
          public MaxOutMemory() {
            System.out.println("Starting array allocation");
            Collection list = new ArrayList();
            try {
              for (int i = 0; i < 10000000; i++) {
                list.add(new String[100000]);
                if (i % 400 == 0) {
                  System.out.println("Executing GC i=" + i);
                  System.gc();
                }
              }
             }
            catch (Exception ex) {
              ex.printStackTrace();
            }

          }

          public static void main(String args[]) {
              MaxOutMemory m = new MaxOutMemory();

              System.exit(95);
          }
        }

        I could not reproduce this failure on a Sun machine because when I ran the test I got a different assert failure.

        # Internal Error (/BUILD_AREA/jdk1.5.0/hotspot/src/share/vm/gc_implementation/p
        arallelScavenge/psPromotionLAB.cpp, 134 [ Patched ]), pid=3859, tid=8
        #
        # Java VM: Java HotSpot(TM) Server VM (1.5.0-b64-debug interpreted mode)
        #
        # Error: assert(_start_array->covered_region().contains(lab),"Sanity")
        ###@###.### 2005-04-12 01:11:46 GMT

              jmasa Jon Masamitsu (Inactive)
              ksoshals Kirill Soshalskiy (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: