Changeset 184720 in webkit


Ignore:
Timestamp:
May 21, 2015 10:45:21 AM (9 years ago)
Author:
Chris Dumez
Message:

Regression(r179293): We no longer call destroyDecodedData() on CachedResources on memory pressure
https://bugs.webkit.org/show_bug.cgi?id=145270
<rdar://problem/20734901>

Reviewed by Andreas Kling.

We no longer call destroyDecodedData() on CachedResources on memory
pressure after r179293. In r179293, we started calling
MemoryCache::evictResources() on memory pressure instead of
MemoryCache::pruneToPercentage(0). However, unlike
MemoryCache::pruneToPercentage(), it appears
MemoryCache::evictResources() removes the CachedResources from the
memory cache without calling destroyDecodedData() on them.
This caused a regression on Membuster.

This patch now calls MemoryCache::pruneLiveResourcesToSize(0) on
critical memory pressure, instead of evictResources(). We don't need to
call pruneDeadResourcesToSize(0) here because the non-critical memory
pressure handler already takes care of this.

During local testing, this change seemed to decrease the overall memory
usage of WebProcesses by ~10MB on Membuster (tested on Yosemite).

  • platform/MemoryPressureHandler.cpp:

(WebCore::MemoryPressureHandler::releaseNoncriticalMemory):
(WebCore::MemoryPressureHandler::releaseCriticalMemory):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r184719 r184720  
     12015-05-21  Chris Dumez  <cdumez@apple.com>
     2
     3        Regression(r179293): We no longer call destroyDecodedData() on CachedResources on memory pressure
     4        https://bugs.webkit.org/show_bug.cgi?id=145270
     5        <rdar://problem/20734901>
     6
     7        Reviewed by Andreas Kling.
     8
     9        We no longer call destroyDecodedData() on CachedResources on memory
     10        pressure after r179293. In r179293, we started calling
     11        MemoryCache::evictResources() on memory pressure instead of
     12        MemoryCache::pruneToPercentage(0). However, unlike
     13        MemoryCache::pruneToPercentage(), it appears
     14        MemoryCache::evictResources() removes the CachedResources from the
     15        memory cache without calling destroyDecodedData() on them.
     16        This caused a regression on Membuster.
     17
     18        This patch now calls MemoryCache::pruneLiveResourcesToSize(0) on
     19        critical memory pressure, instead of evictResources(). We don't need to
     20        call pruneDeadResourcesToSize(0) here because the non-critical memory
     21        pressure handler already takes care of this.
     22
     23        During local testing, this change seemed to decrease the overall memory
     24        usage of WebProcesses by ~10MB on Membuster (tested on Yosemite).
     25
     26        * platform/MemoryPressureHandler.cpp:
     27        (WebCore::MemoryPressureHandler::releaseNoncriticalMemory):
     28        (WebCore::MemoryPressureHandler::releaseCriticalMemory):
     29
    1302015-05-21  Said Abou-Hallawa  <sabouhallawa@apple.com>
    231
  • trunk/Source/WebCore/platform/MemoryPressureHandler.cpp

    r184041 r184720  
    9696
    9797    {
    98         ReliefLogger log("Evict MemoryCache dead resources");
     98        ReliefLogger log("Prune MemoryCache dead resources");
    9999        MemoryCache::singleton().pruneDeadResourcesToSize(0);
    100100    }
     
    111111
    112112    {
    113         ReliefLogger log("Evict all MemoryCache resources");
    114         MemoryCache::singleton().evictResources();
     113        ReliefLogger log("Prune MemoryCache live resources");
     114        MemoryCache::singleton().pruneLiveResourcesToSize(0);
    115115    }
    116116
Note: See TracChangeset for help on using the changeset viewer.