<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>17097</bug_id>
          
          <creation_ts>2008-01-30 11:38:02 -0800</creation_ts>
          <short_desc>CGFontRefs (and HFONTs on Windows) leak because FontCache grows without bound</short_desc>
          <delta_ts>2008-07-25 12:12:11 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Text</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Adam Roben (:aroben)">aroben</reporter>
          <assigned_to>mitz</assigned_to>
          <cc>eric</cc>
    
    <cc>hyatt</cc>
    
    <cc>mitz</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>68816</commentid>
    <comment_count>0</comment_count>
    <who name="Adam Roben (:aroben)">aroben</who>
    <bug_when>2008-01-30 11:38:02 -0800</bug_when>
    <thetext>The FontCache currently grows without bound, which means we&apos;re leaking the CGFontRefs and HFONTs used to construct the FontPlatformData objects held by the cache.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68818</commentid>
    <comment_count>1</comment_count>
    <who name="Adam Roben (:aroben)">aroben</who>
    <bug_when>2008-01-30 11:39:03 -0800</bug_when>
    <thetext>Some quotes from Hyatt on this issue:

&lt;dhyatt&gt; it&apos;s not obvious how to change it without hurting perf
&lt;dhyatt&gt; the tentative idea i had was to refcount FontDatas
&lt;dhyatt&gt; and just pretend like FontPlatformData is always a &quot;temporary&quot;
&lt;dhyatt&gt; to avoid massive refcount churn on the fontplatformdata
&lt;dhyatt&gt; if you look at fontdata&apos;s destructor
&lt;dhyatt&gt; (i guess simplefontdata now)
&lt;dhyatt&gt; it does actually have code to delete the HFONT and release the cgfontref
&lt;dhyatt&gt; it never gets called
&lt;dhyatt&gt; i just mean i wrote the code assuming that someday the fontdatas would get destroyed
&lt;dhyatt&gt; purged from the cache etc
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68820</commentid>
    <comment_count>2</comment_count>
    <who name="Adam Roben (:aroben)">aroben</who>
    <bug_when>2008-01-30 11:39:44 -0800</bug_when>
    <thetext>&lt;rdar://problem/5715471&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>76115</commentid>
    <comment_count>3</comment_count>
    <who name="">mitz</who>
    <bug_when>2008-04-01 19:25:00 -0700</bug_when>
    <thetext>*** Bug 18263 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>76119</commentid>
    <comment_count>4</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2008-04-01 22:35:52 -0700</bug_when>
    <thetext>This doesn&apos;t matter much on OS X (I don&apos;t think).  But on Windows, there are only 65k GDI Object Handles  per user session.  These handle &quot;leaks&quot; can end up causing Safari to take up an unfair number of handles.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>76123</commentid>
    <comment_count>5</comment_count>
    <who name="">mitz</who>
    <bug_when>2008-04-01 23:04:31 -0700</bug_when>
    <thetext>The HFONTs are now owned by the FontPlatformData (not the SimpleFontData). One possible solution would be to have a way to invalidate those and make the SimpleFontData check the validity before any other accees. You&apos;ll also need a way to regenerate the FontPlatformData if they were invalidated (you need a FontDescription and a family name for that IIRC).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>80222</commentid>
    <comment_count>6</comment_count>
    <who name="">mitz</who>
    <bug_when>2008-05-12 14:07:47 -0700</bug_when>
    <thetext>Fixed in &lt;http://trac.webkit.org/changeset/33056&gt;.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>82024</commentid>
    <comment_count>7</comment_count>
    <who name="">mitz</who>
    <bug_when>2008-05-31 00:57:39 -0700</bug_when>
    <thetext>The bug is not fixed in TOT. PlatformFontData objects which hold on to HFONTs and CGFontRefs are still held indefinitely by the FontPlatformDataCache.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>86948</commentid>
    <comment_count>8</comment_count>
    <who name="">mitz</who>
    <bug_when>2008-07-25 12:12:11 -0700</bug_when>
    <thetext>&lt;http://trac.webkit.org/changeset/35352&gt;.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>