Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4109815

java.lang.ref.SoftReference instances not being cleared in time

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 1.2.0
    • Fix Version/s: 1.2.0
    • Component/s: core-libs
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      1.2beta4
    • CPU:
      sparc
    • OS:
      solaris_2.6
    • Verification:
      Not verified

      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]) );
      }
      }
      }

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              mr Mark Reinhold
              Reporter:
              rmandelsunw Ronan Mandel (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: