-
Bug
-
Resolution: Fixed
-
P3
-
11, 12, 13
-
b03
-
generic
-
os_x
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8232698 | 11.0.6-oracle | Sergey Bylokhov | P3 | Resolved | Fixed | b02 |
JDK-8230173 | 11.0.5 | Sergey Bylokhov | P3 | Resolved | Fixed | b05 |
JDK-8239524 | openjdk8u252 | Simon Tooke | P3 | Resolved | Fixed | b04 |
While working on some other bug, i found a few memory leaks which may cause the application crash because of not enough of memory:
Test to reproduce, you need to wait hour or so, depends from the system:
import java.awt.Color;
import java.awt.Frame;
import java.awt.Point;
import java.awt.Robot;
import java.util.List;
/**
* @test
* @key headful
* @bug 8215105
* @summary tests that Robot can capture the common colors without
* artifacts
*/
public final class CheckCommonColors {
private static final Frame frame = new Frame();
private static Robot robot;
public static void main(final String[] args) throws Exception {
robot = new Robot();
try {
test();
} finally {
frame.dispose();
}
}
private static void test() {
frame.setSize(400, 400);
frame.setLocationRelativeTo(null);
frame.setUndecorated(true);
while (true)
for (final Color color : List.of(Color.WHITE, Color.LIGHT_GRAY,
Color.GRAY, Color.DARK_GRAY,
Color.BLACK, Color.RED, Color.PINK,
Color.ORANGE, Color.YELLOW,
Color.GREEN, Color.MAGENTA,
Color.CYAN, Color.BLUE)) {
frame.dispose();
frame.setBackground(color);
frame.setVisible(true);
checkPixels(color);
}
}
private static void checkPixels(final Color color) {
int attempt = 0;
Point p = frame.getLocationOnScreen();
Color pixel = robot.getPixelColor(p.x + frame.getWidth() / 2,
p.y + frame.getHeight() / 2);
if (color.equals(pixel)) {
return;
}
}
}
Test to reproduce, you need to wait hour or so, depends from the system:
import java.awt.Color;
import java.awt.Frame;
import java.awt.Point;
import java.awt.Robot;
import java.util.List;
/**
* @test
* @key headful
* @bug 8215105
* @summary tests that Robot can capture the common colors without
* artifacts
*/
public final class CheckCommonColors {
private static final Frame frame = new Frame();
private static Robot robot;
public static void main(final String[] args) throws Exception {
robot = new Robot();
try {
test();
} finally {
frame.dispose();
}
}
private static void test() {
frame.setSize(400, 400);
frame.setLocationRelativeTo(null);
frame.setUndecorated(true);
while (true)
for (final Color color : List.of(Color.WHITE, Color.LIGHT_GRAY,
Color.GRAY, Color.DARK_GRAY,
Color.BLACK, Color.RED, Color.PINK,
Color.ORANGE, Color.YELLOW,
Color.GREEN, Color.MAGENTA,
Color.CYAN, Color.BLUE)) {
frame.dispose();
frame.setBackground(color);
frame.setVisible(true);
checkPixels(color);
}
}
private static void checkPixels(final Color color) {
int attempt = 0;
Point p = frame.getLocationOnScreen();
Color pixel = robot.getPixelColor(p.x + frame.getWidth() / 2,
p.y + frame.getHeight() / 2);
if (color.equals(pixel)) {
return;
}
}
}
- backported by
-
JDK-8230173 Memory leaks in the AWT on macOS
-
- Resolved
-
-
JDK-8232698 Memory leaks in the AWT on macOS
-
- Resolved
-
-
JDK-8239524 Memory leaks in the AWT on macOS
-
- Resolved
-
- links to