Changeset 209456 in webkit


Ignore:
Timestamp:
Dec 7, 2016, 8:27:34 AM (9 years ago)
Author:
akling@apple.com
Message:

[iOS] Remove bitrotted FrameLoader attempt to limit page caching under memory pressure.
<https://webkit.org/b/165527>

Reviewed by Antti Koivisto.

This code no longer does anything, as the page cache is hard capped
at 0 entries while under memory pressure.

  • loader/FrameLoader.cpp:

(WebCore::FrameLoader::commitProvisionalLoad):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r209451 r209456  
     12016-12-07  Andreas Kling  <akling@apple.com>
     2
     3        [iOS] Remove bitrotted FrameLoader attempt to limit page caching under memory pressure.
     4        <https://webkit.org/b/165527>
     5
     6        Reviewed by Antti Koivisto.
     7
     8        This code no longer does anything, as the page cache is hard capped
     9        at 0 entries while under memory pressure.
     10
     11        * loader/FrameLoader.cpp:
     12        (WebCore::FrameLoader::commitProvisionalLoad):
     13
    1142016-12-06  Antoine Quint  <graouts@apple.com>
    215
  • trunk/Source/WebCore/loader/FrameLoader.cpp

    r209181 r209456  
    137137#include "ResourceLoader.h"
    138138#include "RuntimeApplicationChecks.h"
    139 #include "SystemMemory.h"
    140139#include "WKContentObservation.h"
    141140#endif
     
    149148
    150149static const char defaultAcceptHeader[] = "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8";
    151 
    152 #if PLATFORM(IOS)
    153 const int memoryLevelThresholdToPrunePageCache = 20;
    154 #endif
    155150
    156151bool isBackForwardLoadType(FrameLoadType type)
     
    17661761        m_frame.document() ? m_frame.document()->url().stringCenterEllipsizedToLength().utf8().data() : "",
    17671762        pdl ? pdl->url().stringCenterEllipsizedToLength().utf8().data() : "<no provisional DocumentLoader>");
    1768 
    1769 #if PLATFORM(IOS)
    1770     // In the case where we are not navigating to a cached page, and the system is under (speculative) memory pressure,
    1771     // we can try to preemptively release some of the pages in the cache.
    1772     // FIXME: Right now the capacity is 1 on iOS devices with 256 MB of RAM, so this will always blow away the whole
    1773     // page cache. We could still preemptively prune the page cache while navigating to a cached page if capacity > 1.
    1774     // See <rdar://problem/11779846> for more details.
    1775     if (!cachedPage) {
    1776         if (MemoryPressureHandler::singleton().isUnderMemoryPressure()) {
    1777             LOG(MemoryPressure, "Pruning page cache because under memory pressure at: %s", __PRETTY_FUNCTION__);
    1778             LOG(PageCache, "Pruning page cache to 0 due to memory pressure");
    1779             // Don't cache any page if we are under memory pressure.
    1780             PageCache::singleton().pruneToSizeNow(0, PruningReason::MemoryPressure);
    1781         } else if (systemMemoryLevel() <= memoryLevelThresholdToPrunePageCache) {
    1782             LOG(MemoryPressure, "Pruning page cache because system memory level is %d at: %s", systemMemoryLevel(), __PRETTY_FUNCTION__);
    1783             auto& pageCache = PageCache::singleton();
    1784             LOG(PageCache, "Pruning page cache to %d due to low memory (level %d less or equal to %d threshold)", pageCache.maxSize() / 2, systemMemoryLevel(), memoryLevelThresholdToPrunePageCache);
    1785             pageCache.pruneToSizeNow(pageCache.maxSize() / 2, PruningReason::MemoryPressure);
    1786         }
    1787     }
    1788 #endif
    17891763
    17901764    willTransitionToCommitted();
Note: See TracChangeset for help on using the changeset viewer.