Changeset 220346 in webkit


Ignore:
Timestamp:
Aug 7, 2017 11:42:34 AM (7 years ago)
Author:
commit-queue@webkit.org
Message:

Unreviewed, rolling out r220144.
https://bugs.webkit.org/show_bug.cgi?id=175276

"It did not actually speed things up in the way I expected"
(Requested by saamyjoon on #webkit).

Reverted changeset:

"On memory-constrained iOS devices, reduce the rate at which
the JS heap grows before a GC to try to keep more memory
available for the system"
https://bugs.webkit.org/show_bug.cgi?id=175041
http://trac.webkit.org/changeset/220144

Location:
trunk/Source/JavaScriptCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r220342 r220346  
     12017-08-07  Commit Queue  <commit-queue@webkit.org>
     2
     3        Unreviewed, rolling out r220144.
     4        https://bugs.webkit.org/show_bug.cgi?id=175276
     5
     6        "It did not actually speed things up in the way I expected"
     7        (Requested by saamyjoon on #webkit).
     8
     9        Reverted changeset:
     10
     11        "On memory-constrained iOS devices, reduce the rate at which
     12        the JS heap grows before a GC to try to keep more memory
     13        available for the system"
     14        https://bugs.webkit.org/show_bug.cgi?id=175041
     15        http://trac.webkit.org/changeset/220144
     16
    1172017-08-07  Ryan Haddad  <ryanhaddad@apple.com>
    218
  • trunk/Source/JavaScriptCore/heap/Heap.cpp

    r220186 r220346  
    7272#if PLATFORM(IOS)
    7373#include <bmalloc/bmalloc.h>
    74 #include <sys/sysctl.h>
    7574#endif
    7675#include <wtf/CurrentTime.h>
     
    118117}
    119118
     119size_t proportionalHeapSize(size_t heapSize, size_t ramSize)
     120{
    120121#if PLATFORM(IOS)
    121 static bool useAggressiveGCTrigger()
    122 {
    123     static bool useAggressiveGCTrigger;
    124     static std::once_flag once;
    125     std::call_once(once, [] {
    126         useAggressiveGCTrigger = false;
    127 
    128         if (Options::forceAggressiveGCTrigger()) {
    129             useAggressiveGCTrigger = true;
    130             return;
    131         }
    132 
    133         uint64_t memSizeInBytes;
    134         size_t sizeofMemSize = sizeof(memSizeInBytes);
    135         if (sysctlbyname("hw.memsize", &memSizeInBytes, &sizeofMemSize, nullptr, 0))
    136             return;
    137         useAggressiveGCTrigger = memSizeInBytes <= 1 * GB;
    138     });
    139 
    140     return useAggressiveGCTrigger;
    141 }
    142 #endif
    143 
    144 size_t proportionalHeapSize(size_t heapSize, size_t ramSize)
    145 {
    146 #if PLATFORM(IOS)
    147     if (useAggressiveGCTrigger()) {
    148         double memoryUsed = bmalloc::api::percentAvailableMemoryInUse();
    149         double result = ((1 - memoryUsed) / Options::aggressiveGCTriggerScalingValue()) + 1;
    150         return heapSize * std::max(std::min(result, Options::aggressiveGCTriggerMaxMultiplier()), Options::aggressiveGCTriggerMinMultiplier());
    151     }
    152 
    153122    size_t memoryFootprint = bmalloc::api::memoryFootprint();
    154123    if (memoryFootprint < ramSize * Options::smallHeapRAMFraction())
  • trunk/Source/JavaScriptCore/runtime/Options.h

    r220262 r220346  
    211211    v(double, mediumHeapGrowthFactor, 1.5, Normal, nullptr) \
    212212    v(double, largeHeapGrowthFactor, 1.24, Normal, nullptr) \
    213     v(bool, forceAggressiveGCTrigger, false, Normal, "If true, on iOS, we will use a different formula for proportionalHeapSize().") \
    214     v(double, aggressiveGCTriggerMinMultiplier, 1.07, Normal, "This is the minimum we must grow by for proportionalHeapSize() when doing aggressive triggering.") \
    215     v(double, aggressiveGCTriggerMaxMultiplier, 2.0, Normal,  "This is the maximum we can grow by for proportionalHeapSize() when doing aggressive triggering.") \
    216     v(double, aggressiveGCTriggerScalingValue, 3.5, Normal, "This scales the above formula. A larger number is more aggressive in limiting heap growth. A smaller number is more permissive in allowing heap growth.") \
    217213    v(double, criticalGCMemoryThreshold, 0.80, Normal, "percent memory in use the GC considers critical.  The collector is much more aggressive above this threshold") \
    218214    v(double, minimumMutatorUtilization, 0, Normal, nullptr) \
Note: See TracChangeset for help on using the changeset viewer.