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

Curious difference in time of 1000 Windows creation.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: P3 P3
    • 9
    • 9
    • client-libs
    • None
    • 2 very similar Ubuntu 16.04, jdk9 circa b150

      I have 2 almost identical Dell boxes with properly updated Ubuntu 16.04 Unity. Let's call them Slow and Fast.
      'free -h' output on Slow:
                    total used free shared buff/cache available
      Mem: 7,8G 1,3G 542M 8,8M 5,9G 6,1G
      Swap: 2,9G 421M 2,5G

      The same on Fast:
                    total used free shared buff/cache available
      Mem: 7,8G 1,0G 3,0G 23M 3,7G 6,4G
      Swap: 14G 0B 14G

      Both of them has dual-head accelerated cards, ATI Radeon on Slow and NVidia GeForce on Fast, and very similar monitors. Processors are i7-2600 and i7-3770, corresp.

      Now, the problem: the excerpt from a test creating 1000 owned Windows always runs almost 8 minutes on Slow and 1m16s on Fast. This time doesn't depend much whether we use -mx128m flag or not.

      import java.awt.Frame;
      import java.awt.Window;
      import java.lang.ref.WeakReference;
      import java.util.Vector;

      public class OwnedWindowsLeak
      {
          public static void main(String[] args)
          {
              Frame owner = new Frame("F");

              // First, create many windows
              Vector<WeakReference<Window>> children =
                  new Vector<WeakReference<Window>>();
              for (int i = 0; i < 1000; i++)
              {
                  Window child = new Window(owner);
                  children.add(new WeakReference<Window>(child));
              }
              owner.dispose();
          }
      }

      I'm making this bug P3 since the difference is so huge; please investigate, and if the reason allows, decrease the priority.

            serb Sergey Bylokhov
            yan Yuri Nesterenko (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: