Changeset 208975 in webkit


Ignore:
Timestamp:
Nov 25, 2016 6:59:07 AM (7 years ago)
Author:
akling@apple.com
Message:

MemoryPressureHandler should only trigger synchronous GC on iOS
<https://webkit.org/b/165043>
<rdar://problem/29312684>

Reviewed by Sam Weinig.

On iOS we know that there is really only one web process in play at a time,
so it's okay to do a synchronous GC immediately in response to high memory pressure.

On other platforms, we may have tens or hundreds of web processes, and if they
all start doing full GCs at the same time, it can easily bring a system to its knees
if it's already under pressure.

Fix this by using garbageCollectSoon() on non-iOS platforms.

  • page/MemoryRelease.cpp:

(WebCore::releaseCriticalMemory):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r208973 r208975  
     12016-11-25  Andreas Kling  <akling@apple.com>
     2
     3        MemoryPressureHandler should only trigger synchronous GC on iOS
     4        <https://webkit.org/b/165043>
     5        <rdar://problem/29312684>
     6
     7        Reviewed by Sam Weinig.
     8
     9        On iOS we know that there is really only one web process in play at a time,
     10        so it's okay to do a synchronous GC immediately in response to high memory pressure.
     11
     12        On other platforms, we may have tens or hundreds of web processes, and if they
     13        all start doing full GCs at the same time, it can easily bring a system to its knees
     14        if it's already under pressure.
     15
     16        Fix this by using garbageCollectSoon() on non-iOS platforms.
     17
     18        * page/MemoryRelease.cpp:
     19        (WebCore::releaseCriticalMemory):
     20
    1212016-11-23  Sergio Villar Senin  <svillar@igalia.com>
    222
  • trunk/Source/WebCore/page/MemoryRelease.cpp

    r208534 r208975  
    126126        MemoryPressureHandler::ReliefLogger log("Collecting JavaScript garbage");
    127127        GCController::singleton().garbageCollectNow();
    128     } else
     128    } else {
     129#if PLATFORM(IOS)
    129130        GCController::singleton().garbageCollectNowIfNotDoneRecently();
     131#else
     132        GCController::singleton().garbageCollectSoon();
     133#endif
     134    }
    130135
    131136    // We reduce tiling coverage while under memory pressure, so make sure to drop excess tiles ASAP.
Note: See TracChangeset for help on using the changeset viewer.