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

Add documentation to TestOutOfMemoryDuringInit.java

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 24
    • None
    • hotspot
    • b10

      The test uses `theList.add(new Object());` to trigger OOM. From the context, it's not obvious whether the choice of the allocation size is of significance or not.

      However, the choice is on purpose, as David put it:

      ```
      The size is significant. We need to be sure there is not enough memory to create the ExceptionInInitializerError that the VM tries to create when the clinit throws the OOM. If you allocate big chunks we may get the OOM but still have memory left over for the EIIE.
      ```

      Add doc around this to make the intention explicit.

            ayang Albert Yang
            ayang Albert Yang
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: