19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 import java.awt.FlowLayout;
25 import java.awt.Robot;
26 import java.lang.ref.Reference;
27 import java.lang.ref.WeakReference;
28 import java.util.ArrayList;
29 import java.util.List;
30 import javax.swing.JButton;
31 import javax.swing.JFrame;
32 import javax.swing.JPanel;
33 import javax.swing.JTextField;
34 import javax.swing.SwingUtilities;
35 import test.java.awt.regtesthelpers.Util;
36
37 /*
38 @test
39 @bug 7079260
40 @summary XInputContext leaks memory by needRecetXXIClient field
41 @author Petr Pchelko
42 @library ../../regtesthelpers
43 @build Util
44 @compile InputContextMemoryLeakTest.java
45 @run main/othervm -Xmx20M InputContextMemoryLeakTest
46 */
47 public class InputContextMemoryLeakTest {
48
49 private static JFrame frame;
50 private static WeakReference<JTextField> text;
51 private static WeakReference<JPanel> p;
52 private static JButton button;
53
54 public static void init() throws Throwable {
55 SwingUtilities.invokeAndWait(new Runnable() {
56 @Override
57 public void run() {
58 frame = new JFrame();
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 import java.awt.FlowLayout;
25 import java.awt.Robot;
26 import java.lang.ref.Reference;
27 import java.lang.ref.WeakReference;
28 import java.util.ArrayList;
29 import java.util.List;
30 import javax.swing.JButton;
31 import javax.swing.JFrame;
32 import javax.swing.JPanel;
33 import javax.swing.JTextField;
34 import javax.swing.SwingUtilities;
35 import test.java.awt.regtesthelpers.Util;
36
37 /*
38 @test
39 @key headful
40 @bug 7079260
41 @summary XInputContext leaks memory by needRecetXXIClient field
42 @author Petr Pchelko
43 @library ../../regtesthelpers
44 @build Util
45 @compile InputContextMemoryLeakTest.java
46 @run main/othervm -Xmx20M InputContextMemoryLeakTest
47 */
48 public class InputContextMemoryLeakTest {
49
50 private static JFrame frame;
51 private static WeakReference<JTextField> text;
52 private static WeakReference<JPanel> p;
53 private static JButton button;
54
55 public static void init() throws Throwable {
56 SwingUtilities.invokeAndWait(new Runnable() {
57 @Override
58 public void run() {
59 frame = new JFrame();
|