-
CSR
-
Resolution: Approved
-
P4
-
None
-
behavioral
-
minimal
-
Java API
-
SE
Summary
The applications are blocked in a small method, even if they use the different BufferedImages and different threads.
Problem
When the graphics object is created for BufferedImage it will call:
GraphicsEnvironment env = GraphicsEnvironment.getLocalGraphicsEnvironment();
return env.createGraphics(this);
The problem is that getLocalGraphicsEnvironment() is a static and synchronized method.
Solution
Reimplement the method to not require synchronization and drop the "synchronized" keyword from the getLocalGraphicsEnvironment() method to reduce the overhead of the method in multi-core environments.
Specification
java/awt/GraphicsEnvironment.java
/**
* Returns the local {@code GraphicsEnvironment}.
* @return the local {@code GraphicsEnvironment}
*/
-public static synchronized GraphicsEnvironment getLocalGraphicsEnvironment() {
+public static GraphicsEnvironment getLocalGraphicsEnvironment() {
- csr of
-
JDK-8185093 Expensive multi-core choke point when any graphics objects are created
-
- Resolved
-