United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
JDK-6338472 : Fonts created with createFont not being freed by GC.

Details
Type:
Bug
Submit Date:
2005-10-18
Status:
Resolved
Updated Date:
2010-04-02
Project Name:
JDK
Resolved Date:
2005-11-21
Component:
client-libs
OS:
generic
Sub-Component:
2d
CPU:
generic
Priority:
P4
Resolution:
Fixed
Affected Versions:
5.0,6
Fixed Versions:

Related Reports
Backport:

Sub Tasks

Description
Fonts created with createFont have never been freed until JRE exit although in 1.5
code was added that was supposed to allow this and use the "2D disposer" mechanism
once the font became unreferenced to free the native resources (ie temporary file)
created.

Unfortunately the disposer record keeps a strong reference to the Font (actually
the Font2D) itself due to making the disposer class a non-static nested (inner)
class of the Font2D subclass and so implicitly it has a reference to its enclosing
instance.

                                    

Comments
EVALUATION

The fix is simply to make those inner classes static.
                                     
2005-10-18



Hardware and Software, Engineered to Work Together