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

[TESTBUG] Some Introspector tests fail with a Java heap bigger than 4GB

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 9
    • Component/s: client-libs
    • Labels:

      Backports

        Description

        The three Introspector test:

        java/beans/Introspector/7064279/Test7064279.java
        java/beans/Introspector/Test7172865.java
        java/beans/Introspector/Test7195106.java

        provoke an OutOfMemory situation by repeatedly allocating constantly growing arrays with the following loop:

        int[] array = new int[1024];
          while (true) {
          array = new int[array.length << 1];
        }

        However if we're running on a machine with plenty of RAM the default Java heap will be bigger than ~4GB and we will get a NegativeArraySizeException instead of an OutOfMemoryError because the array length which is a signed int will wrap around and become negative.

        The fix is easy - just specify a concrete -Xmx value for the test.

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                simonis Volker Simonis
                Reporter:
                simonis Volker Simonis
                Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved: