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

[macOS] Robot.waitForIdle() works really slow on a certain apple hardware

XMLWordPrintable

    • 9
    • x86
    • os_x

      ADDITIONAL SYSTEM INFORMATION :
      MacBook / macOS 10.14.5 / jdk-11.0.3 and jdk-12.0.1


      A DESCRIPTION OF THE PROBLEM :
      On a certain apple hardware Robot.waitForIdle() may take 20 sec while normally it works about 20-40 ms.

      This is not an issue of the specific machine as the issue is reproducible on at least two different MacBooks.
      This is regression since jdk1.8.0_212 as Robot.waitForIdle() works ok with this jdk on the hardware (1) below.

      Example of the hardware (1) where Robot.waitForIdle() works bad, stably taking 20 sec on jdk-11.0.3 and jdk-12.0.1:

        OS: macOS Mojave 10.14.5
        Model Name: MacBook Pro
        Model Identifier: MacBookPro11,5
        Processor Name: Intel Core i7
        Processor Speed: 2,5 GHz
        Number of Processors: 1
        Total Number of Cores: 4
        L2 Cache (per Core): 256 KB
        L3 Cache: 6 MB
        Hyper-Threading Technology: Enabled
        Memory: 16 GB
        Boot ROM Version: 192.0.0.0.0
        SMC Version (system): 2.30f2
        Serial Number (system): *
        Hardware UUID: *

      Example of the hardware (2) where Robot.waitForIdle() works ok, about 20 ms, on the same jdk-11.0.3 and jdk-12.0.1:

        OS: macOS Mojave 10.14.5
        Model Name: MacBook Pro
        Model Identifier: MacBookPro15,1
        Processor Name: Intel Core i7
        Processor Speed: 2,6 GHz
        Number of Processors: 1
        Total Number of Cores: 6
        L2 Cache (per Core): 256 KB
        L3 Cache: 9 MB
        Hyper-Threading Technology: Enabled
        Memory: 16 GB
        Boot ROM Version: 220.260.171.0.0 (iBridge: 16.16.5200.0.0,0)
        Serial Number (system): *
        Hardware UUID: *

      REGRESSION : Last worked in version 8u212

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Please compile and run the WaitForIdleTest.java:

      <javac> WaitForIdleTest.java
      <java> WaitForIdleTest

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Robot.waitForIdle() takes about 20 ms to complete on hardware (1) (with jdk1.8.0_212).

      <jdk1.8.0_212.jdk>/Contents/Home/bin/java WaitForIdleTest
      Robot.waitForIdle() eplased time: 16
      ACTUAL -
      Robot.waitForIdle() takes about 20 sec to complete on hardware (1) (with jdk-11.0.3 and jdk-12.0.1).

      <jdk-11.0.3.jdk>/Contents/Home/bin/java WaitForIdleTest
      Robot.waitForIdle() eplased time: 20033 ms

      <jdk-12.0.1.jdk>/Contents/Home/bin/java WaitForIdleTest
      Robot.waitForIdle() eplased time: 20034 ms

      ---------- BEGIN SOURCE ----------
      import java.awt.*;

      public class WaitForIdleTest {

          public static void main(String[] args) throws Exception {

              Robot robot = new Robot();

              Frame frame = new Frame();
              frame.setSize(100, 100);
              frame.setVisible(true);

              long start = System.currentTimeMillis();
              robot.waitForIdle();
              long end = System.currentTimeMillis();

              frame.dispose();

              long eplasedTime = end - start;
              System.out.println("Robot.waitForIdle() eplased time: " + eplasedTime + " ms");
          }
      }
      ---------- END SOURCE ----------

      FREQUENCY : always


            pardesha Pardeep Sharma
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: