Skip to content
Permalink
Browse files
[iOS WebKit2] Web process should try to shrink its memory footprint w…
…hen going into background.

<https://webkit.org/b/133197>
<rdar://problem/17011561>

Source/WebCore:
Make releaseMemory() public so we can call it from the process-will-suspend callback.

Reviewed by Gavin Barraclough.

* WebCore.exp.in:
* platform/MemoryPressureHandler.h:

Source/WebKit2:
Try to free up as much memory as possible before going into background.

Reviewed by Gavin Barraclough.

* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::processWillSuspend):

Canonical link: https://commits.webkit.org/151212@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@169237 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
Andreas Kling committed May 23, 2014
1 parent 3616ae7 commit 4589dd404bb689d92b14e22bc88381ac03e7aab9
Showing with 30 additions and 1 deletion.
  1. +13 −0 Source/WebCore/ChangeLog
  2. +1 −0 Source/WebCore/WebCore.exp.in
  3. +2 −1 Source/WebCore/platform/MemoryPressureHandler.h
  4. +13 −0 Source/WebKit2/ChangeLog
  5. +1 −0 Source/WebKit2/WebProcess/WebProcess.cpp
@@ -1,3 +1,16 @@
2014-05-22 Andreas Kling <akling@apple.com>

[iOS WebKit2] Web process should try to shrink its memory footprint when going into background.
<https://webkit.org/b/133197>
<rdar://problem/17011561>

Make releaseMemory() public so we can call it from the process-will-suspend callback.

Reviewed by Gavin Barraclough.

* WebCore.exp.in:
* platform/MemoryPressureHandler.h:

2014-05-22 Andreas Kling <akling@apple.com>

Hook up a setting for showing detailed logging during memory pressure relief.
@@ -876,6 +876,7 @@ __ZN7WebCore21BlobDataFileReferenceD2Ev
__ZN7WebCore21CrossThreadCopierBaseILb0ELb0EN3WTF6StringEE4copyERKS2_
__ZN7WebCore21CrossThreadCopierBaseILb0ELb0ENS_19IDBDatabaseMetadataEE4copyERKS1_
__ZN7WebCore21MemoryPressureHandler12ReliefLogger16s_loggingEnabledE
__ZN7WebCore21MemoryPressureHandler13releaseMemoryEb
__ZN7WebCore21MemoryPressureHandler7installEv
__ZN7WebCore21NetworkStorageSession21defaultStorageSessionEv
__ZN7WebCore21NetworkStorageSession25switchToNewTestingSessionEv
@@ -97,6 +97,8 @@ class MemoryPressureHandler {
static bool s_loggingEnabled;
};

static void releaseMemory(bool critical);

private:
void uninstall();

@@ -106,7 +108,6 @@ class MemoryPressureHandler {
~MemoryPressureHandler();

void respondToMemoryPressure();
static void releaseMemory(bool critical);
static void platformReleaseMemory(bool critical);

bool m_installed;
@@ -1,3 +1,16 @@
2014-05-22 Andreas Kling <akling@apple.com>

[iOS WebKit2] Web process should try to shrink its memory footprint when going into background.
<https://webkit.org/b/133197>
<rdar://problem/17011561>

Try to free up as much memory as possible before going into background.

Reviewed by Gavin Barraclough.

* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::processWillSuspend):

2014-05-22 Andreas Kling <akling@apple.com>

Hook up a setting for showing detailed logging during memory pressure relief.
@@ -1168,6 +1168,7 @@ void WebProcess::resetAllGeolocationPermissions()

void WebProcess::processWillSuspend()
{
memoryPressureHandler().releaseMemory(true);
parentProcessConnection()->send(Messages::WebProcessProxy::ProcessReadyToSuspend(), 0);
}

0 comments on commit 4589dd4

Please sign in to comment.