JDK-4690117 : VolatileImage never recovers lost surface in FullScreenTest
  • Type: Bug
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 1.4.0
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_2000
  • CPU: x86
  • Submitted: 2002-05-22
  • Updated: 2002-08-27
  • Resolved: 2002-08-27
Related Reports
Duplicate :  
Relates :  
Description
Windows 2000 / NVIDIA GeForce 3

Run either FullScreenTest or FullScreenTest2, then ALT+TAB to force surface loss.  The app will loop endlessly in the Volatile Image / back buffer code waiting for the surface to recover, which never happens.  Theoretically, a VolatileImage should fall back to software in this case, but this obviously isn't happening.

Note that the loop in these tests has been commented out with a reference to this bug number, so you will have to uncomment out this code in order to reproduce the problem.

Comments
EVALUATION I cannot tell from the description what code this is talking about - there is no commented-out loop as far as I can see in the code. Also, alt-tab-related b ugs are presumably fixed by the fix to 4641396. I am closing this one out as a duplicate of that bug. ###@###.### 2002-08-27 I finally found the commented-out code mentioned in the Description: it's in the test itself (FullScreenTest and FullScreenTest2). I also discovered more about the cause of the problem. The test is written in a manner that I hope is not duplicated in the field: we are running in a tight loop (no Sleep() calls), calling render() every time through the loop. render() creates a new VolatileImage, draws a line to it, and ends (assuming that everything worked). One of the problems that the app runs into is running out of video memory; when we are creating new images this fast, the garbage collector may not get around to collecting the old images fast enough for there to be enough video memory left over for new images. So eventually, we will fail in our attempt to create a hardware surface. Presumably, this triggers a flag in the VolatileImage object that the surface was lost, so that contentsLost() will return true. We then try to recreate the image, fail, etc. This seems to be compounded by being alt-tabbed out of the application (perhaps we cannot create video memory surfaces while our app is minimized?). Ideally, the application should not be attacking the problem this way. A better way to run this tight loop would be to have one VolatileImage that we keep reusing. When I rewrite the app to do this, I no longer get the inifinite loop while alt-tabbed problem. However, it is still a problem that we are not resetting the flags appropriately when we are in a situation where we simply cannot create a hardware surface. I will submit a new bug with a lower priority since I think this is probably a rare circumstance in reality. ###@###.### 2002-09-26
26-09-2002