JDK-6307416 : Memory consumption increases every time I push a frame to FS mode and restore it back, Linux
  • Type: Bug
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 6
  • Priority: P3
  • Status: Open
  • Resolution: Unresolved
  • OS: linux_sun
  • CPU: x86
  • Submitted: 2005-08-06
  • Updated: 2012-01-16
Related Reports
Relates :  
Description
I am running a multi-monitor test on a Cinnabar-linux machine having an ATI Radeon 9600XT video card. In this test, I am actually looping through all the GCs available with the GraphicsDev and creating a frame, rendering some 2D contents on it. I am pushing this frame to FS mode and restoring it back. 

When I do this, the memory consumption slowly increases with every iteration, especially when I am pushing the frame to FS mode. The memory consumption goes as high as 55 MB. This does not happen with FS mode simulation (prior to b39 where the frame just gets resized to the bounds of the GC) and seen only in FullScreen Exclusive mode. Looks like some resources are not freed up when restoring the FS frame to normal mode. With OGL pipeline, the test attached here actually throws OutOfMemoryError with the default heap size due to this problem. With simulated mode, the max memory consumed was just 5 MB on an average at the end of the loop but with FS exclusive mode, it is actually 55 MB. 

I monitored this using JConsole and the consumption increases like a stair case. This is reproducible only on Linux and not on Win32. I reproduced it with Mustang-b45. I have also attached the output of xdpyinfo.

I have attached a tar file. Extract it and run the test as follows:
java FrameFullScreenTest true
true - FS exclusive mode
false - FS simulated mode

If you run it with OGL, you would see OutOfMemoryError after some iterations.

Comments
EVALUATION Most likely involves complex cycle of object dependencies that is preventing objects (and possibly native data) from being freed, but that's just a guess at this point. More investigation required. It's not a terribly severe issue for most user scenarios since most fullscreen apps change display modes no more than once or twice over the lifespan of the app.
23-09-2005