JDK-6347637 : Some MultiMonitor tests got OutOfMemoryError in mustang b58 in GeForce6600 card
  • Type: Bug
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 6
  • Priority: P2
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2005-11-08
  • Updated: 2010-04-03
  • Resolved: 2005-11-23
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.
JDK 6
6Resolved
Related Reports
Duplicate :  
Description
Java Version: 1.6.0-beta-b58
Platform: windowsXPpro with sp2.
Graphic card: Nvidia GeForce6600 with driver version: 81.85
1024X768 and 32 bit color depth.
The host: jfcsqe_earth.sfbay in 2d-sqe lab with two monitors set up.
It is Pentium 4 with cpu 1.5GHZ, 256 MB

Problem:
When run multiMoniotr tests in mustang recent builds, say b58, some tests got exceptions as OutOfMemoryError: Java heap space
It is OK with tiger and tiger update builds, 1.5.0-fcs-b64 and 1.5.0_05-b05
Trace back to mustang b46, still got exceptions.

The machine is newly updated with Nvidi driver 81.85 which released on Oct 20th,2005
It may be a driver bug, I run b58 with the same tests in Matrox G450 card in win2k with multiMonitor set up, they are OK.

Here are the three tests:
CreateFrameVirtualScreenTest, CreateDialogVirtualScreenTest, CreateWindowVirtualScreenTest

The exceptions as followings:
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
	at sun.awt.windows.WRobotPeer.getRGBPixels(WRobotPeer.java:59)
	at java.awt.Robot.createScreenCapture(Robot.java:298)
	at MultiScreenCaptureTest.captureScreen(MultiScreenCaptureTest.java:107)
	at CreateFrameVirtualScreenTest.createFrame(CreateFrameVirtualScreenTest.java:134)
	at CreateFrameVirtualScreenTest.<init>(CreateFrameVirtualScreenTest.java:55)
	at CreateFrameVirtualScreenTest.main(CreateFrameVirtualScreenTest.java:149)

How to reproduce:
Run one of the three tests by mustang recent build in the machine, you will see the exception, it can be reproducible all times.

The test case is attached.
This does not look like a driver issue. I am able to reproduce this on other multimon config (WinXP) which use ATI Rage Pro and Intel Onboard graphics controller. I have uptated my Nvidia driver to 81.94 and ran the test with Tiger-FCS as well as Mustang-b59/b58 and monitored the application through JConsole. On Tiger-FCS, the Mem usage graph appeared more or less like a Saw-Tooth whereas on Mustang-b59, it appears like a stair-case. The video driver and the machine are the same. Hence it looks like some regression introduced before b58. This is not reproducible on Solaris with Mustang-b59.

If you run the attached test on a single mon app, you may not actually get OutOfMemError since the app terminates before it could exhaust the heap. But it is very obvious on multi-mon configs.

Comments
EVALUATION I've narrowed the test down to this: import java.awt.Canvas; import java.awt.Frame; import java.awt.Graphics; import java.awt.GraphicsConfiguration; import java.awt.Window; class AWTRenderingContents extends Canvas { public AWTRenderingContents(GraphicsConfiguration gc) { super(gc); } public void paint (Graphics g) { } public static void main (String args[]) { for (int i = 0; i < 20; i++) { Frame f = new Frame("AWTRenderingContents"); f.setSize(400, 400); f.setLocation(10, 10); f.add(new AWTRenderingContents(f.getGraphicsConfiguration())); f.addWindowListener(new java.awt.event.WindowAdapter() { public void windowClosing(java.awt.event.WindowEvent we) { Window w = (Window) we.getSource(); w.dispose(); System.gc(); System.runFinalization(); System.gc(); System.runFinalization(); System.gc(); System.runFinalization(); System.gc(); System.runFinalization(); } }); f.setVisible(true); } } } When the test is run I close all but one frame manually, then run jmap -dump to dump the heap. From time to time some instances of AWTRenderingContents are not being released. This happens because there's a single global JNI reference preventing canvas objects from being collected. In the original test case the canvas has a back-buffer which is a buffered image, so after a few instances we run out of heap and throw OOE. This bug is actually a duplicate of: 6337388: CTE_REGTEST/Generic/4347545 fails, mustang
23-11-2005