[iOS WebKit2] Web process should try to shrink its memory footprint when going into...
authorakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 23 May 2014 01:36:10 +0000 (01:36 +0000)
committerakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 23 May 2014 01:36:10 +0000 (01:36 +0000)
<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):

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

Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/platform/MemoryPressureHandler.h
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/WebProcess.cpp

index b8bb233..2704e53 100644 (file)
@@ -1,5 +1,18 @@
 2014-05-22  Andreas Kling  <akling@apple.com>
 
 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.
         <https://webkit.org/b/133194>
 
         Hook up a setting for showing detailed logging during memory pressure relief.
         <https://webkit.org/b/133194>
 
index 2e8c8a2..a167337 100644 (file)
@@ -876,6 +876,7 @@ __ZN7WebCore21BlobDataFileReferenceD2Ev
 __ZN7WebCore21CrossThreadCopierBaseILb0ELb0EN3WTF6StringEE4copyERKS2_
 __ZN7WebCore21CrossThreadCopierBaseILb0ELb0ENS_19IDBDatabaseMetadataEE4copyERKS1_
 __ZN7WebCore21MemoryPressureHandler12ReliefLogger16s_loggingEnabledE
 __ZN7WebCore21CrossThreadCopierBaseILb0ELb0EN3WTF6StringEE4copyERKS2_
 __ZN7WebCore21CrossThreadCopierBaseILb0ELb0ENS_19IDBDatabaseMetadataEE4copyERKS1_
 __ZN7WebCore21MemoryPressureHandler12ReliefLogger16s_loggingEnabledE
+__ZN7WebCore21MemoryPressureHandler13releaseMemoryEb
 __ZN7WebCore21MemoryPressureHandler7installEv
 __ZN7WebCore21NetworkStorageSession21defaultStorageSessionEv
 __ZN7WebCore21NetworkStorageSession25switchToNewTestingSessionEv
 __ZN7WebCore21MemoryPressureHandler7installEv
 __ZN7WebCore21NetworkStorageSession21defaultStorageSessionEv
 __ZN7WebCore21NetworkStorageSession25switchToNewTestingSessionEv
index 4c3c475..4f92cbd 100644 (file)
@@ -97,6 +97,8 @@ public:
         static bool s_loggingEnabled;
     };
 
         static bool s_loggingEnabled;
     };
 
+    static void releaseMemory(bool critical);
+
 private:
     void uninstall();
 
 private:
     void uninstall();
 
@@ -106,7 +108,6 @@ private:
     ~MemoryPressureHandler();
 
     void respondToMemoryPressure();
     ~MemoryPressureHandler();
 
     void respondToMemoryPressure();
-    static void releaseMemory(bool critical);
     static void platformReleaseMemory(bool critical);
 
     bool m_installed;
     static void platformReleaseMemory(bool critical);
 
     bool m_installed;
index 386c899..6a0da6b 100644 (file)
@@ -1,5 +1,18 @@
 2014-05-22  Andreas Kling  <akling@apple.com>
 
 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.
         <https://webkit.org/b/133194>
 
         Hook up a setting for showing detailed logging during memory pressure relief.
         <https://webkit.org/b/133194>
 
index 52a628d..20dd46a 100644 (file)
@@ -1168,6 +1168,7 @@ void WebProcess::resetAllGeolocationPermissions()
     
 void WebProcess::processWillSuspend()
 {
     
 void WebProcess::processWillSuspend()
 {
+    memoryPressureHandler().releaseMemory(true);
     parentProcessConnection()->send(Messages::WebProcessProxy::ProcessReadyToSuspend(), 0);
 }
     
     parentProcessConnection()->send(Messages::WebProcessProxy::ProcessReadyToSuspend(), 0);
 }