<?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>18955</bug_id>
          
          <creation_ts>2008-05-08 15:53:49 -0700</creation_ts>
          <short_desc>CachedScript and CachedCSSStyleSheet double-retain memory</short_desc>
          <delta_ts>2008-12-05 10:03:56 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebCore Misc.</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>UNCONFIRMED</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter name="Mike Belshe">mbelshe</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>79937</commentid>
    <comment_count>0</comment_count>
    <who name="Mike Belshe">mbelshe</who>
    <bug_when>2008-05-08 15:53:49 -0700</bug_when>
    <thetext>CachedScript and CachedCSSStyleSheet both derive from CachedResource.  CachedResource contains a StringBuffer m_data.

Internally, when data is assigned to the CachedScript and CachedCSSStyleSheet, they decode the m_data buffer, and store the result into a private string (m_script and m_sheet, respectively).

Thus, each of these objects has two in-memory copies of the cached object.  The m_data is actually not needed and can be removed.  The only thing which uses it is the InspectorController; and that usage can be removed with a small amount of work.

For www.cnn.com, this led to a 600KB footprint reduction.
For www.yahoo.com, this led to a ~2MB footprint reduction.

I will post a patch when it&apos;s ready.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>79944</commentid>
    <comment_count>1</comment_count>
    <who name="Mark Rowe (bdash)">mrowe</who>
    <bug_when>2008-05-08 17:27:46 -0700</bug_when>
    <thetext>*** Bug 18956 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>101514</commentid>
    <comment_count>2</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2008-12-05 10:03:56 -0800</bug_when>
    <thetext>Is this still an issue?</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>