From 6a4018577f9454f8eda75cba18ae9b16d40dae69 Mon Sep 17 00:00:00 2001 From: "akling@apple.com" Date: Mon, 9 Dec 2013 21:15:20 +0000 Subject: [PATCH] REGRESSION(r160260): Memory pressure signal causes web process to hang. Reviewed by Tim Horton. This command caused all of my web processes to hang: notifyutil -p org.WebKit.lowMemory This only happens when the cache pruning code encounters a resource using purgeable memory. * loader/cache/MemoryCache.cpp: (WebCore::MemoryCache::pruneLiveResourcesToSize): Grab the next CachedResource pointer before continuing the loop. git-svn-id: http://svn.webkit.org/repository/webkit/trunk@160327 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- Source/WebCore/ChangeLog | 19 +++++++++++++++++++ Source/WebCore/loader/cache/MemoryCache.cpp | 4 +++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog index 8b673466968..2023950d1c1 100644 --- a/Source/WebCore/ChangeLog +++ b/Source/WebCore/ChangeLog @@ -1,3 +1,22 @@ +2013-12-09 Andreas Kling + + REGRESSION(r160260): Memory pressure signal causes web process to hang. + + + Reviewed by Tim Horton. + + This command caused all of my web processes to hang: + + notifyutil -p org.WebKit.lowMemory + + This only happens when the cache pruning code encounters a resource + using purgeable memory. + + * loader/cache/MemoryCache.cpp: + (WebCore::MemoryCache::pruneLiveResourcesToSize): + + Grab the next CachedResource pointer before continuing the loop. + 2013-12-09 peavo@outlook.com [WinCairo] OpenGL compile error. diff --git a/Source/WebCore/loader/cache/MemoryCache.cpp b/Source/WebCore/loader/cache/MemoryCache.cpp index 5fab5103a9e..506f6414eb8 100644 --- a/Source/WebCore/loader/cache/MemoryCache.cpp +++ b/Source/WebCore/loader/cache/MemoryCache.cpp @@ -266,8 +266,10 @@ void MemoryCache::pruneLiveResourcesToSize(unsigned targetSize) if (elapsedTime < cMinDelayBeforeLiveDecodedPrune) return; - if (current->decodedDataIsPurgeable()) + if (current->decodedDataIsPurgeable()) { + current = prev; continue; + } // Destroy our decoded data. This will remove us from // m_liveDecodedResources, and possibly move us to a different LRU -- GitLab