JDK-4193257 : Circular ref. prevents Window objects from being collected
  • Type: Bug
  • Component: client-libs
  • Sub-Component: java.awt
  • Affected Version: 1.2.0
  • Priority: P2
  • Status: Closed
  • Resolution: Duplicate
  • OS: generic
  • CPU: generic
  • Submitted: 1998-11-27
  • Updated: 2013-11-01
  • Resolved: 1999-01-07
Related Reports
Duplicate :  
Description

Name: clC74495			Date: 11/27/98


I have found that java.awt.Window objects are never garbage
collected after I remove all of my references because of a circular
reference in the java.awt.Windows.java code, which I have no
control over.

The Windows constructor sets its private member 'focusMgr' =
new FocusManager(this). Then FocusManager sets its private
member 'focusRoot' to the passed in Window reference.

ANY Application using Window objects will have this serious
memory leak!  If the Window isn't garbage collected then most
of its components aren't either without a lot of work!
PLEASE FIX THIS BEFORE RELEASING JDK1.2!
(Review ID: 43353)
======================================================================

Comments
WORK AROUND Name: clC74495 Date: 11/27/98 NONE ======================================================================
11-06-2004

EVALUATION I believe the FocusManager reference which the user points out is OK. Circular references are themselves not bad things. The GC isn't that stupid. However, it appears that his GC releated problems are due to a input method related problem. The input methods wind up in a static vector and prevent GC. I'm going to dup this bug to 4195507 which I believe is falling prey to the same problem. steve.wilson@eng 1999-01-06
06-01-1999