This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libgcj/16997] New: WeakHashMap leaks memory


The following test case leaks memory. It shouldn't because there is no reference
kept to the keys in the WeakHashMap. Apparantly, something associated with
WeakReferences isn't being released.

import java.util.WeakHashMap;

public class WH2 
{
  public static void main(String[] s) 
  {
    WeakHashMap w = new WeakHashMap();
    while (true)
      {
        WH2 w2 = new WH2();
	w.put(w2, null);
      }
  }
}

-- 
           Summary: WeakHashMap leaks memory
           Product: gcc
           Version: 3.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: libgcj
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: mckinlay at redhat dot com
                CC: gcc-bugs at gcc dot gnu dot org,java-prs at gcc dot gnu
                    dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16997


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]