Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[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):


Canonical link: https://commits.webkit.org/160195@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@180847 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
Andreas Kling committed Mar 1, 2015
1 parent 1824ae7 commit 53cbee0
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Source/WebCore/ChangeLog
@@ -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
Expand Down
6 changes: 6 additions & 0 deletions Source/WebCore/platform/cocoa/MemoryPressureHandlerCocoa.mm
Expand Up @@ -45,11 +45,17 @@
#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())
Expand Down

0 comments on commit 53cbee0

Please sign in to comment.