8080084: java/awt/Graphics2D/DrawString/DrawStringCrash.java fails with G1 GC
Reviewed-by: ssadetsky, pnarayanan
This commit is contained in:
parent
e83a741be2
commit
a9cb8eb350
@ -23,8 +23,9 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* @test
|
* @test
|
||||||
* @bug 8043508
|
* @bug 8043508 8080084
|
||||||
* @summary Drawing a very long string crashes VM
|
* @summary Drawing a very long string crashes VM
|
||||||
|
* @run main/othervm DrawStringCrash
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
@ -53,11 +54,11 @@ public class DrawStringCrash {
|
|||||||
while (len < maxLen) {
|
while (len < maxLen) {
|
||||||
try {
|
try {
|
||||||
g2d.drawString(sb.toString(), 20, 20);
|
g2d.drawString(sb.toString(), 20, 20);
|
||||||
|
sb.append(sb);
|
||||||
|
len *= 2;
|
||||||
} catch (OutOfMemoryError e) {
|
} catch (OutOfMemoryError e) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
sb.append(sb);
|
|
||||||
len *= 2;
|
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user