Changeset 210223 in webkit


Ignore:
Timestamp:
Jan 2, 2017 5:54:17 AM (7 years ago)
Author:
Carlos Garcia Campos
Message:

[GTK] Since the memory pressure relief has been activated, my disk has a high usage and the desktop stalls
https://bugs.webkit.org/show_bug.cgi?id=164052

Reviewed by Michael Catanzaro.

Check how much memory is freed by the memory pressure handler and wait for a long time if we didn't free that
much.

  • platform/linux/MemoryPressureHandlerLinux.cpp:

(WebCore::MemoryPressureHandler::EventFDPoller::EventFDPoller):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r210222 r210223  
     12017-01-02  Carlos Garcia Campos  <cgarcia@igalia.com>
     2
     3        [GTK] Since the memory pressure relief has been activated, my disk has a high usage and the desktop stalls
     4        https://bugs.webkit.org/show_bug.cgi?id=164052
     5
     6        Reviewed by Michael Catanzaro.
     7
     8        Check how much memory is freed by the memory pressure handler and wait for a long time if we didn't free that
     9        much.
     10
     11        * platform/linux/MemoryPressureHandlerLinux.cpp:
     12        (WebCore::MemoryPressureHandler::EventFDPoller::EventFDPoller):
     13
    1142017-01-02  Chris Fleizach  <cfleizach@apple.com>
    215
  • trunk/Source/WebCore/platform/linux/MemoryPressureHandlerLinux.cpp

    r209744 r210223  
    5454// s_holdOffMultiplier times the last cleanup processing time. Effectively
    5555// this is 1 / s_holdOffMultiplier percent of the time.
     56// If after releasing the memory we don't free at least s_minimumBytesFreedToUseMinimumHoldOffTime,
     57// we wait longer to try again (s_maximumHoldOffTime).
    5658// These value seems reasonable and testing verifies that it throttles frequent
    5759// low memory events, greatly reducing CPU usage.
    5860static const unsigned s_minimumHoldOffTime = 5;
     61static const unsigned s_maximumHoldOffTime = 30;
     62static const size_t s_minimumBytesFreedToUseMinimumHoldOffTime = 1 * MB;
    5963static const unsigned s_holdOffMultiplier = 20;
    6064
     
    285289
    286290    double startTime = monotonicallyIncreasingTime();
     291    int64_t processMemory = processMemoryUsage();
    287292    releaseMemory(critical, synchronous);
    288     unsigned holdOffTime = (monotonicallyIncreasingTime() - startTime) * s_holdOffMultiplier;
     293    int64_t bytesFreed = processMemory - processMemoryUsage();
     294    unsigned holdOffTime = s_maximumHoldOffTime;
     295    if (bytesFreed > 0 && static_cast<size_t>(bytesFreed) >= s_minimumBytesFreedToUseMinimumHoldOffTime)
     296        holdOffTime = (monotonicallyIncreasingTime() - startTime) * s_holdOffMultiplier;
    289297    holdOff(std::max(holdOffTime, s_minimumHoldOffTime));
    290298}
Note: See TracChangeset for help on using the changeset viewer.