Skip to main content

[JAVA2D] Using a slower sun.java2d.pipe.DrawImage.renderSurfaceData() ?

1 reply [Last post]
Anonymous

I have a window that is taking up a lot of CPU from the EDT to draw,
whereas several other windows doing similar operations do not. When I
profile (using OptimizeIt) showing just this problematic window, I get
that the AWT-EventQueue-0 thread spends 34% of its time in
sun.java2d.pipe.DrawImage.blitSurfaceData():

34.20% - 3330 ms - sun.java2d.pipe.DrawImage.renderSurfaceData()

getting there from java.awt.EventQueue.dispatchEvent(). When I profile
showing just a non-problematic window, this thread spends only 3% if its
time in renderSurfaceData. In fact, they have very different sets of
calls for under RepaintManager.paintDirtyRegions(). (I've attached the
two profiles -- data.html is for the problematic window.)

[I tried attaching in a previous post, but I think my mail tool had a
problem with them. I've listed the callstacks following this text. Sorry if
this ends up being a duplicate post. Having many problems with mailtool.]

I even commented out the majority of what is displayed so that the
window is pretty much blank, but is still using about half of the CPU.

What would cause one window to use a slower renderSurfaceData?

Brian

Slower window callstack from profile:
java.awt.EventDispatchThread.run()
java.awt.EventDispatchThread.pumpEvents()
java.awt.EventDispatchThread.pumpEvents()
java.awt.EventDispatchThread.pumpEventsForHierarchy()
java.awt.EventDispatchThread.pumpOneEventForHierarchy()
java.awt.EventQueue.dispatchEvent()
java.awt.event.InvocationEvent.dispatch()
javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run()
javax.swing.RepaintManager.paintDirtyRegions()
javax.swing.JComponent.paintImmediately()
javax.swing.JComponent._paintImmediately()
javax.swing.JComponent.paintDoubleBuffered()
javax.swing.JComponent.paintWithOffscreenBuffer()
sun.java2d.SunGraphics2D.drawImage()
sun.java2d.SunGraphics2D.drawImage()
sun.java2d.pipe.ValidatePipe.copyImage()
sun.java2d.pipe.DrawImage.copyImage()
sun.java2d.pipe.DrawImage.copyImage()
sun.java2d.pipe.DrawImage.copyImage()
sun.java2d.pipe.DrawImage.renderSurfaceData()
sun.java2d.pipe.DrawImage.blitSurfaceData()

Faster window callstack from profile:
java.awt.EventDispatchThread.run()
java.awt.EventDispatchThread.pumpEvents()
java.awt.EventDispatchThread.pumpEvents()
java.awt.EventDispatchThread.pumpEventsForHierarchy()
java.awt.EventDispatchThread.pumpOneEventForHierarchy()
java.awt.EventQueue.dispatchEvent()
java.awt.event.InvocationEvent.dispatch()
javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run()
javax.swing.RepaintManager.paintDirtyRegions()
javax.swing.JComponent.paintImmediately()
javax.swing.JComponent._paintImmediately()
javax.swing.JComponent.paintDoubleBuffered()
javax.swing.JComponent.paintWithOffscreenBuffer()
javax.swing.JComponent.paint()
javax.swing.JComponent.paintChildren()
javax.swing.JComponent.paint()
javax.swing.JComponent.paintChildren()
javax.swing.JComponent.paint()
javax.swing.JComponent.paintChildren()
javax.swing.JComponent.paint()
javax.swing.JComponent.paintChildren()
javax.swing.JComponent.paint()
javax.swing.JComponent.paintChildren()
javax.swing.JComponent.paint()
javax.swing.JComponent.paintChildren()
javax.swing.JComponent.paint()
javax.swing.JComponent.paintComponent()
javax.swing.plaf.ComponentUI.update()

===========================================================================
To unsubscribe, send email to listserv@java.sun.com and include in the body
of the message "signoff JAVA2D-INTEREST". For general help, send email to
listserv@java.sun.com and include in the body of the message "help".

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Chet Haase

Brian,

My quick take on this is that you've run out of VRAM eventually and this
latest window is creating a back buffer (or any other offscreen images)
in system memory. When that's the case (as it was on jdk 1.3.1 and previous
versions), we spend a lot of time just pumping pixels down from the CPU to
the framebuffer.

Make sense?

Chet.

Brian Peterson wrote:

>I have a window that is taking up a lot of CPU from the EDT to draw,
>whereas several other windows doing similar operations do not. When I
>profile (using OptimizeIt) showing just this problematic window, I get
>that the AWT-EventQueue-0 thread spends 34% of its time in
>sun.java2d.pipe.DrawImage.blitSurfaceData():
>
> 34.20% - 3330 ms - sun.java2d.pipe.DrawImage.renderSurfaceData()
>
>getting there from java.awt.EventQueue.dispatchEvent(). When I profile
>showing just a non-problematic window, this thread spends only 3% if its
>time in renderSurfaceData. In fact, they have very different sets of
>calls for under RepaintManager.paintDirtyRegions(). (I've attached the
>two profiles -- data.html is for the problematic window.)
>
>[I tried attaching in a previous post, but I think my mail tool had a
>problem with them. I've listed the callstacks following this text. Sorry if
>this ends up being a duplicate post. Having many problems with mailtool.]
>
>I even commented out the majority of what is displayed so that the
>window is pretty much blank, but is still using about half of the CPU.
>
>What would cause one window to use a slower renderSurfaceData?
>
>Brian
>
>Slower window callstack from profile:
>java.awt.EventDispatchThread.run()
>java.awt.EventDispatchThread.pumpEvents()
>java.awt.EventDispatchThread.pumpEvents()
>java.awt.EventDispatchThread.pumpEventsForHierarchy()
>java.awt.EventDispatchThread.pumpOneEventForHierarchy()
>java.awt.EventQueue.dispatchEvent()
>java.awt.event.InvocationEvent.dispatch()
>javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run()
>javax.swing.RepaintManager.paintDirtyRegions()
>javax.swing.JComponent.paintImmediately()
>javax.swing.JComponent._paintImmediately()
>javax.swing.JComponent.paintDoubleBuffered()
>javax.swing.JComponent.paintWithOffscreenBuffer()
>sun.java2d.SunGraphics2D.drawImage()
>sun.java2d.SunGraphics2D.drawImage()
>sun.java2d.pipe.ValidatePipe.copyImage()
>sun.java2d.pipe.DrawImage.copyImage()
>sun.java2d.pipe.DrawImage.copyImage()
>sun.java2d.pipe.DrawImage.copyImage()
>sun.java2d.pipe.DrawImage.renderSurfaceData()
>sun.java2d.pipe.DrawImage.blitSurfaceData()
>
>Faster window callstack from profile:
>java.awt.EventDispatchThread.run()
>java.awt.EventDispatchThread.pumpEvents()
>java.awt.EventDispatchThread.pumpEvents()
>java.awt.EventDispatchThread.pumpEventsForHierarchy()
>java.awt.EventDispatchThread.pumpOneEventForHierarchy()
>java.awt.EventQueue.dispatchEvent()
>java.awt.event.InvocationEvent.dispatch()
>javax.swing.SystemEventQueueUtilities$ComponentWorkRequest.run()
>javax.swing.RepaintManager.paintDirtyRegions()
>javax.swing.JComponent.paintImmediately()
>javax.swing.JComponent._paintImmediately()
>javax.swing.JComponent.paintDoubleBuffered()
>javax.swing.JComponent.paintWithOffscreenBuffer()
>javax.swing.JComponent.paint()
>javax.swing.JComponent.paintChildren()
>javax.swing.JComponent.paint()
>javax.swing.JComponent.paintChildren()
>javax.swing.JComponent.paint()
>javax.swing.JComponent.paintChildren()
>javax.swing.JComponent.paint()
>javax.swing.JComponent.paintChildren()
>javax.swing.JComponent.paint()
>javax.swing.JComponent.paintChildren()
>javax.swing.JComponent.paint()
>javax.swing.JComponent.paintChildren()
>javax.swing.JComponent.paint()
>javax.swing.JComponent.paintComponent()
>javax.swing.plaf.ComponentUI.update()
>
>===========================================================================
>To unsubscribe, send email to listserv@java.sun.com and include in the body
>of the message "signoff JAVA2D-INTEREST". For general help, send email to
>listserv@java.sun.com and include in the body of the message "help".
>
>

===========================================================================
To unsubscribe, send email to listserv@java.sun.com and include in the body
of the message "signoff JAVA2D-INTEREST". For general help, send email to
listserv@java.sun.com and include in the body of the message "help".