Title: [234201] branches/safari-606-branch/Source/bmalloc
Revision
234201
Author
bshaf...@apple.com
Date
2018-07-25 10:00:46 -0700 (Wed, 25 Jul 2018)

Log Message

Cherry-pick r234185. rdar://problem/42586981

    Revert back to using phys_footprint to calculate isUnderMemoryPressure()
    https://bugs.webkit.org/show_bug.cgi?id=187919
    <rdar://problem/42552888>

    Reviewed by Simon Fraser.

    Currently on iOS, bmalloc will run the scavenger more frequently when it detects
    that the process is under memory pressure. However, it only uses bmalloc's
    own footprint as a percentage of the HW available memory to determine if
    the process is under memory pressure. This is a change I recently made
    in an effort to run the scavenger less when bmalloc wasn't contributing
    to the dirty footprint in the process. However, this fails to run the
    scavenger eagerly when the process in question has a heap split
    between a lot of dirty bmalloc memory as well as a lot of dirty memory
    from elsewhere. We also have evidence that we may have increased jetsams
    in the Web Content process. Since my original change was not a measurable
    speedup, this patch reverts isUnderMemoryPressure() to its previous
    behavior of using phys_footprint to determine if 75% of the available
    HW memory is being used.

    * bmalloc/AvailableMemory.cpp:
    (bmalloc::memoryStatus):

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

Modified Paths

Diff

Modified: branches/safari-606-branch/Source/bmalloc/ChangeLog (234200 => 234201)


--- branches/safari-606-branch/Source/bmalloc/ChangeLog	2018-07-25 17:00:43 UTC (rev 234200)
+++ branches/safari-606-branch/Source/bmalloc/ChangeLog	2018-07-25 17:00:46 UTC (rev 234201)
@@ -1,3 +1,58 @@
+2018-07-25  Babak Shafiei  <bshaf...@apple.com>
+
+        Cherry-pick r234185. rdar://problem/42586981
+
+    Revert back to using phys_footprint to calculate isUnderMemoryPressure()
+    https://bugs.webkit.org/show_bug.cgi?id=187919
+    <rdar://problem/42552888>
+    
+    Reviewed by Simon Fraser.
+    
+    Currently on iOS, bmalloc will run the scavenger more frequently when it detects
+    that the process is under memory pressure. However, it only uses bmalloc's
+    own footprint as a percentage of the HW available memory to determine if
+    the process is under memory pressure. This is a change I recently made
+    in an effort to run the scavenger less when bmalloc wasn't contributing
+    to the dirty footprint in the process. However, this fails to run the
+    scavenger eagerly when the process in question has a heap split
+    between a lot of dirty bmalloc memory as well as a lot of dirty memory
+    from elsewhere. We also have evidence that we may have increased jetsams
+    in the Web Content process. Since my original change was not a measurable
+    speedup, this patch reverts isUnderMemoryPressure() to its previous
+    behavior of using phys_footprint to determine if 75% of the available
+    HW memory is being used.
+    
+    * bmalloc/AvailableMemory.cpp:
+    (bmalloc::memoryStatus):
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@234185 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2018-07-24  Saam Barati  <sbar...@apple.com>
+
+            Revert back to using phys_footprint to calculate isUnderMemoryPressure()
+            https://bugs.webkit.org/show_bug.cgi?id=187919
+            <rdar://problem/42552888>
+
+            Reviewed by Simon Fraser.
+
+            Currently on iOS, bmalloc will run the scavenger more frequently when it detects
+            that the process is under memory pressure. However, it only uses bmalloc's
+            own footprint as a percentage of the HW available memory to determine if
+            the process is under memory pressure. This is a change I recently made
+            in an effort to run the scavenger less when bmalloc wasn't contributing
+            to the dirty footprint in the process. However, this fails to run the
+            scavenger eagerly when the process in question has a heap split
+            between a lot of dirty bmalloc memory as well as a lot of dirty memory
+            from elsewhere. We also have evidence that we may have increased jetsams
+            in the Web Content process. Since my original change was not a measurable
+            speedup, this patch reverts isUnderMemoryPressure() to its previous
+            behavior of using phys_footprint to determine if 75% of the available
+            HW memory is being used.
+
+            * bmalloc/AvailableMemory.cpp:
+            (bmalloc::memoryStatus):
+
 2019-07-12  Michael Saboff  <msab...@apple.com>
 
         Disable IsoHeaps when Gigacage is off

Modified: branches/safari-606-branch/Source/bmalloc/bmalloc/AvailableMemory.cpp (234200 => 234201)


--- branches/safari-606-branch/Source/bmalloc/bmalloc/AvailableMemory.cpp	2018-07-25 17:00:43 UTC (rev 234200)
+++ branches/safari-606-branch/Source/bmalloc/bmalloc/AvailableMemory.cpp	2018-07-25 17:00:46 UTC (rev 234201)
@@ -108,16 +108,12 @@
 #if BPLATFORM(IOS)
 MemoryStatus memoryStatus()
 {
-    size_t memoryFootprint;
-    if (PerProcess<Environment>::get()->isDebugHeapEnabled()) {
-        task_vm_info_data_t vmInfo;
-        mach_msg_type_number_t vmSize = TASK_VM_INFO_COUNT;
-        
-        memoryFootprint = 0;
-        if (KERN_SUCCESS == task_info(mach_task_self(), TASK_VM_INFO, (task_info_t)(&vmInfo), &vmSize))
-            memoryFootprint = static_cast<size_t>(vmInfo.phys_footprint);
-    } else
-        memoryFootprint = PerProcess<Scavenger>::get()->footprint();
+    task_vm_info_data_t vmInfo;
+    mach_msg_type_number_t vmSize = TASK_VM_INFO_COUNT;
+    
+    size_t memoryFootprint = 0;
+    if (KERN_SUCCESS == task_info(mach_task_self(), TASK_VM_INFO, (task_info_t)(&vmInfo), &vmSize))
+        memoryFootprint = static_cast<size_t>(vmInfo.phys_footprint);
 
     double percentInUse = static_cast<double>(memoryFootprint) / static_cast<double>(availableMemory());
     double percentAvailableMemoryInUse = std::min(percentInUse, 1.0);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to