[Cocoa] Purge SQLite page cache when under memory pressure.
authorakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 1 Mar 2015 02:31:16 +0000 (02:31 +0000)
committerakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 1 Mar 2015 02:31:16 +0000 (02:31 +0000)
<https://webkit.org/b/142139>
<rdar://problem/19997739>

Reviewed by Pratik Solanki.

Call out to sqlite3 cache purging SPI on Cocoa platforms when
we need to free up some extra memory.

* platform/cocoa/MemoryPressureHandlerCocoa.mm:
(WebCore::MemoryPressureHandler::platformReleaseMemory):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@180847 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/platform/cocoa/MemoryPressureHandlerCocoa.mm

index d8080f5..9bf3497 100644 (file)
@@ -1,3 +1,17 @@
+2015-02-28  Andreas Kling  <akling@apple.com>
+
+        [Cocoa] Purge SQLite page cache when under memory pressure.
+        <https://webkit.org/b/142139>
+        <rdar://problem/19997739>
+
+        Reviewed by Pratik Solanki.
+
+        Call out to sqlite3 cache purging SPI on Cocoa platforms when
+        we need to free up some extra memory.
+
+        * platform/cocoa/MemoryPressureHandlerCocoa.mm:
+        (WebCore::MemoryPressureHandler::platformReleaseMemory):
+
 2015-02-28  Simon Fraser  <simon.fraser@apple.com>
 
         FrameView::layoutTimerFired() should update style if needed before doing layout
index 6746ffa..9bac00b 100644 (file)
 #endif
 
 extern "C" void cache_simulate_memory_warning_event(uint64_t);
+extern "C" void _sqlite3_purgeEligiblePagerCacheMemory(void);
 
 namespace WebCore {
 
 void MemoryPressureHandler::platformReleaseMemory(bool critical)
 {
     {
+        ReliefLogger log("Purging SQLite caches");
+        _sqlite3_purgeEligiblePagerCacheMemory();
+    }
+
+    {
         ReliefLogger log("Drain LayerPools");
         for (auto& pool : LayerPool::allLayerPools())
             pool->drain();