JDK-4109815 : java.lang.ref.SoftReference instances not being cleared in time
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.lang
  • Affected Version: 1.2.0
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: solaris_2.6
  • CPU: sparc
  • Submitted: 1998-02-05
  • Updated: 1999-01-15
  • Resolved: 1999-01-15
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
1.2.0 1.2beta4Fixed
Related Reports
Relates :  
Description

Name: rm29839			Date: 02/05/98


I see the java.OutOfMemoryError exception nested
in a java.rmi.ServerError exception from a server
that is using  CachedRef to conserve memory.

Programs that provoke the condition are too large
to type in here.  I'd be happy to provide them
if you tell me how.

Date: Thu, 5 Feb 1998 11:40:09 -0800 (PST)
From: Moti Thadani <###@###.###>
Subject: Re: Similar to bug 4076283 - condition persists on jdk1.2beta2

Ron,

I'm attaching the necessary jar files and a script to run the programs.
If you copy the attached files to a directory and run the script (jb.sh) on a 
system with jdk1.2beta2 installed and the CLASSPATH environment variable set,
you will see two windows displayed.  The first displays counts and the second 
displays a login window.  The login window should be ignored.  The client 
program (jb.client.jbct) attempts to create an account record on the server 
(jb.server.Club) and sign-in followed by a sign-out.  The server maintains 
account information in a hash table of CachedReferences.  At any time there is 
exactly one instance of the account record that is referenced by a non-cached 
reference.  The size of the account record is (artificially) set to

When the heap is exhausted on the server, cached references are reaped and the 
storage reclaimed.  Thus, the server should never run out of memory.  As you'll 
see when you run my programs, you will see a number of memory failures.

Let me know if you need additional information,
Moti

(Review ID: 24596)
======================================================================

Date: Wed, 08 Apr 1998 20:51:23 -0700
From: Franklin Schmidt <###@###.###>
To: java-gc-comments@Eng
Subject: SoftReference doesn't work

SoftReference doesn't work.
A reply to this e-mail would be greatly appreciated.


import java.lang.ref.*;
import java.util.*;

class B {
	public static void main(String[] args) {
		Vector v = new Vector();
		for( int i=0; i<100; i++ ) {
			System.out.println(i);
			v.addElement( new SoftReference(new byte[1000000]) );
		}
	}
}

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: generic FIXED IN: 1.2beta4 INTEGRATED IN: 1.2beta4
14-06-2004

EVALUATION This bug was fixed when the implementation of soft references was pushed down into the garbage collector (4129862). -- mr@eng 6/12/1998
12-06-1998