Bug 18955 - CachedScript and CachedCSSStyleSheet double-retain memory
Summary: CachedScript and CachedCSSStyleSheet double-retain memory
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
: 18956 (view as bug list)
Depends on:
Reported: 2008-05-08 15:53 PDT by Mike Belshe
Modified: 2008-12-05 10:03 PST (History)
0 users

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Mike Belshe 2008-05-08 15:53:49 PDT
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's ready.
Comment 1 Mark Rowe (bdash) 2008-05-08 17:27:46 PDT
*** Bug 18956 has been marked as a duplicate of this bug. ***
Comment 2 Alexey Proskuryakov 2008-12-05 10:03:56 PST
Is this still an issue?