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

Memory leak in Robot on Windows

XMLWordPrintable

    • b09
    • x86
    • windows, windows_xp
    • Not verified

        the problem was reported on forum:

        http://forum.java.sun.com/thread.jspa?threadID=5120823&tstart=0

        Here is the test to reproduce the problem:

        import java.awt.*;
        import javax.swing.*;

        public class JFrameLeak {

            static final long FREQUENCY = 20 * 1000;

            public static void main(String[] arg) {
                
                JFrame f = new JFrame();
                long counter = 0;
                f.setSize(new Dimension(100,100));
                f.show();
                while(true) {
                    try {
                        new Robot().mouseMove(100,100);
                        counter += 1;
                        if (counter % FREQUENCY == 0) {
                            System.out.println("Iteration: " + Long.toString(counter));
                        }
                    } catch (java.awt.AWTException awte) {
                        System.err.println("Caught: " + awte.toString());
                    }
                }
            }
        }

              son Oleg Sukhodolsky (Inactive)
              son Oleg Sukhodolsky (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: