JDK-4718434 : Component.BltBufferStrategy doesn't clean up VolatileImage's on strategy switch
  • Type: Bug
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 1.4.0
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_98
  • CPU: x86
  • Submitted: 2002-07-22
  • Updated: 2019-05-14
  • Resolved: 2019-05-14
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Related Reports
Duplicate :  

Name: jk109818			Date: 07/22/2002

java version "1.4.0_01"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0_01-b03)
Java HotSpot(TM) Client VM (build 1.4.0_01-b03, mixed mode)

Windows 98 [Version 4.10.2222]

When switching Canvas BufferStrategy's from
a BltBufferStrategy that uses VolatileImage
to another strategy (that is, another createBufferStrategy
invocation), the old VolatileImage's aren't flush()'ed.

Around line 2846 of Component.java, there is code to
clean up FlipBufferStrategy.  There should be something
similar for BltBufferStrategy.  In fact I think there
should be an addition to the API for BufferStrategy
for a BufferStrategy.dispose() or flush().  But at least
there should be something for the non-public
BltBufferStrategy similar to FlipBufferStrategy's

The problem can lead to exhausting hardware accelerated

And it worse than that.  The interaction with full screen
mode can be deadly.  I ordinarily use double buffering in my
application with Canvas.createBufferStrategy(2-buffers,
false-for-no-acceleration, true-for-accelerated-back-buffer,
null-for-no-flipping).  When I switch into full screen mode
with another window, I find it necessary to switch off other
hardware accelerated VolatileImage's or there is streen
strobing as they fight over the display.  Then when I switch
back out of full screen mode and dispose of that window, the
Canvas and Frame lock up.  On Windows 98 I see a white
window.  On Linux (Red Hat 7.1) I see the frozen image of
the last image drawn to the non-full screen window before
full screen mode.  In both cases I had to kill the app with
a control-C in the terminal window.

I hacked a version of BltBufferStrategy that did a flush()
on the VolatileImage before switching (into non-double
buffered mode and then) full screen mode, and things were fine.

This bug can be reproduced always.

---------- BEGIN SOURCE ----------
Obvious from inspection of source code for Component.BltBufferStrategy:
VolatileImage's are created, but there's nowhere a flush() to release their
---------- END SOURCE ----------

Once you use a BltBufferStrategy, don't switch to another
strategy.  Or manage your own VolatileImage's.
(Review ID: 153360) 

EVALUATION Note that the white-display problem noted at the end of the Description field is probably the alt-tab bug. See bug 4641396 for more details. ###@###.### 2002-08-27