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

Test sun/java2d/Disposer/TestDisposerRace.java fails with OOME in unexpected location

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: P4 P4
    • 24
    • 24
    • client-libs
    • 2d

      java.lang.OutOfMemoryError: Java heap space
      at java.base/java.lang.Thread.beforeSleep(Thread.java:461)
      at java.base/java.lang.Thread.sleepNanos(Thread.java:491)
      at java.base/java.lang.Thread.sleep(Thread.java:527)
      at TestDisposerRace.giveGCAChance(TestDisposerRace.java:104)
      at TestDisposerRace.generateOOME(TestDisposerRace.java:115)
      at TestDisposerRace.run(TestDisposerRace.java:57)
      at TestDisposerRace.main(TestDisposerRace.java:44)

      giveGCAChance is called after the previous loop has been broken by OOME being thrown. All it does is sleep in a loop and so potentially allow GC a chance to catch up and clear memory before the test moves on. However, since the Loom integration the implementation of Thread.sleep has changed significantly and it can now allocate and so encounter a secondary OOME - hence the current failure.

      The test needs more resilience against OOME in unexpected places.

            vklang Viktor Klang
            dholmes David Holmes
            Votes:
            0 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: