JDK-6195099 : (ref) test/java/lang/ref/SoftReference/Pin.java fails
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.lang
  • Affected Version: 5.0u2
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2004-11-13
  • Updated: 2010-04-02
  • Resolved: 2005-01-27
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.
Other JDK 6
5.0u3 b03Fixed 6Fixed
Description

This regression test fails repeatedly on TL nightly Solaris Sparc
builds for 5.0u2:  it times out.  The problem is that it is
allocating memory too slowly.  I was able to get the test to pass by
changing this line:
		int[] hungry = new int[65536];
to this:
		int[] hungry = new int[6553600];

		
###@###.### 2004-11-13 04:24:01 GMT

Comments
EVALUATION The suggested fix is fine. ###@###.### 2005-1-18 19:26:09 GMT
18-01-2005

SUGGESTED FIX When the JVM is running in server mode, possibly because of ergonomic heuristics, this test will consume excessive amounts of memory and run very slowly. I suggest explicitly specifying a small heap as follows: (since I don't actually understand SoftReferences, and I can't get the test to fail on older JDKs, I leave it to the java.lang.ref maintainer) --- /tmp/geta383 2005-01-03 16:19:42.889574600 -0800 +++ Pin.java 2005-01-03 16:19:13.675950000 -0800 @@ -1,10 +1,11 @@ /* @test %I% %D% * @bug 4076287 * @summary Invoking get on a SoftReference shouldn't pin the referent + * @run main/othervm -Xms12m -Xmx12m Pin * @author Peter Jones * @author Mark Reinhold */ import java.lang.ref.SoftReference; ###@###.### 2005-1-04 00:25:47 GMT
04-01-2005