Title: [234185] trunk/Source/bmalloc
Revision
234185
Author
sbar...@apple.com
Date
2018-07-24 19:09:46 -0700 (Tue, 24 Jul 2018)

Log Message

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):

Modified Paths

Diff

Modified: trunk/Source/bmalloc/ChangeLog (234184 => 234185)


--- trunk/Source/bmalloc/ChangeLog	2018-07-25 01:53:41 UTC (rev 234184)
+++ trunk/Source/bmalloc/ChangeLog	2018-07-25 02:09:46 UTC (rev 234185)
@@ -1,3 +1,28 @@
+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: trunk/Source/bmalloc/bmalloc/AvailableMemory.cpp (234184 => 234185)


--- trunk/Source/bmalloc/bmalloc/AvailableMemory.cpp	2018-07-25 01:53:41 UTC (rev 234184)
+++ trunk/Source/bmalloc/bmalloc/AvailableMemory.cpp	2018-07-25 02:09:46 UTC (rev 234185)
@@ -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