"If left long enough Out-of-memory errors will occur with every reapint."+įrm.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE) "Memory usage of this process appears to jump every time the screen saver starts and stops."+ "Repeat activating the screen saver and deactivating it, several times."+ "Wait a few seconds minutes, stop the screen saver and look at the memory usage of this process."+ "Activate the \"Goldfish Aquarium\" screensaver"+ "Watch the memory consumption of this process."+ "Launch Windows Task ManagerMaximize the size fo this window."+ The memory loss may be proportional to the size of the java application's UI.Įxception in thread "AWT-EventQueue-0" : Java heap space The java application should not lose memory when another process makes use of the graphics card.Įach invocation of the screen saver causes a memory loss in the java application. Repeatedly activate and de-activate the screen saver while watching memory usage of the java process with the Windows task manager.Įventually you will see OutOfMemoryExceptions reported in the console window where you started the Java application.įor me it happens after activating the screen saver for the seventh time. Make sure the screen saver is configured for 16bppĬompile and run the attached Java program from a console with no options (java GraphicLeak). Install the Goldfish Aquarium screen saver from Set your desktop resolution to 1920x1440 32bpp STEPS TO FOLLOW TO REPRODUCE THE PROBLEM : 3D Pipes) don't change the bit depth, or use Direct3D instead of openGL or vice versa, They don't appear to trigger the problem. Presumably the 3D screen savers included with windows (e.g. I have only been able to reproduce this bug with that specific screen saver, only when the screen saver is set to 16 bpp and my desktop is set to 32 bpp. The bug can be seen in Java 1.4.2_05 and Java 5. Simply repeatedly activating and deactivating the screen saver is enough to crash the Java application after only a few iterations. If I run the described Swing app and activate the GoldFish Aquarium screen saver from the swing application will lose a chunk of memory. The tricky bit about the bug, is that it is triggered by a completely different process, in my case a fancy screen blanker that I believe uses OpenGL. I used a JFrame with a single JLabel and called repaint() ten times a second. All that is needed to demonstrate this is a Swing app that repaints the UI periodically. I have noticed that very basic drawing in a Swing application will eventually lead to a memory leak in the AWT Event thread that prevents re-painting. Java HotSpot(TM) Client VM (build 1.5.0-b64, mixed mode) Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-b64)
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |