-
Bug
-
Resolution: Fixed
-
P2
-
1.3.1
-
None
-
beta3
-
generic
-
generic
The code to construct a Graphics object from a BufferedImage causes a
GraphicsConfiguration object to be created for the BufferedImage even
if noone ever calls the getDeviceConfiguration() method on the Graphics
object.
The GraphicsConfig object so constructed is cached for future calls to
getGraphics() and createGraphics(), but as it is rare for a caller to
actually request this object, its creation is a waste. This extra
allocation can affect the amount of garbage created in programs which
create a lot of transient BufferedImage objects.
Note that the internal support for drawing the Raster objects from
custom Paint objects implicitly uses lots of BufferedImage objects so
heavy use of TexturePaint, GradientPaint or other Custom Paint objects
can tickle lots of these allocations.
GraphicsConfiguration object to be created for the BufferedImage even
if noone ever calls the getDeviceConfiguration() method on the Graphics
object.
The GraphicsConfig object so constructed is cached for future calls to
getGraphics() and createGraphics(), but as it is rare for a caller to
actually request this object, its creation is a waste. This extra
allocation can affect the amount of garbage created in programs which
create a lot of transient BufferedImage objects.
Note that the internal support for drawing the Raster objects from
custom Paint objects implicitly uses lots of BufferedImage objects so
heavy use of TexturePaint, GradientPaint or other Custom Paint objects
can tickle lots of these allocations.