Title: [210223] trunk/Source/WebCore
- Revision
- 210223
- Author
- [email protected]
- Date
- 2017-01-02 05:54:17 -0800 (Mon, 02 Jan 2017)
Log 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):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (210222 => 210223)
--- trunk/Source/WebCore/ChangeLog 2017-01-02 09:02:12 UTC (rev 210222)
+++ trunk/Source/WebCore/ChangeLog 2017-01-02 13:54:17 UTC (rev 210223)
@@ -1,3 +1,16 @@
+2017-01-02 Carlos Garcia Campos <[email protected]>
+
+ [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):
+
2017-01-02 Chris Fleizach <[email protected]>
AX: Expose block quote level to iOS API
Modified: trunk/Source/WebCore/platform/linux/MemoryPressureHandlerLinux.cpp (210222 => 210223)
--- trunk/Source/WebCore/platform/linux/MemoryPressureHandlerLinux.cpp 2017-01-02 09:02:12 UTC (rev 210222)
+++ trunk/Source/WebCore/platform/linux/MemoryPressureHandlerLinux.cpp 2017-01-02 13:54:17 UTC (rev 210223)
@@ -53,9 +53,13 @@
// seconds after receiving an event. Don't let events fire any sooner than
// s_holdOffMultiplier times the last cleanup processing time. Effectively
// this is 1 / s_holdOffMultiplier percent of the time.
+// If after releasing the memory we don't free at least s_minimumBytesFreedToUseMinimumHoldOffTime,
+// we wait longer to try again (s_maximumHoldOffTime).
// These value seems reasonable and testing verifies that it throttles frequent
// low memory events, greatly reducing CPU usage.
static const unsigned s_minimumHoldOffTime = 5;
+static const unsigned s_maximumHoldOffTime = 30;
+static const size_t s_minimumBytesFreedToUseMinimumHoldOffTime = 1 * MB;
static const unsigned s_holdOffMultiplier = 20;
static const char* s_cgroupMemoryPressureLevel = "/sys/fs/cgroup/memory/memory.pressure_level";
@@ -284,8 +288,12 @@
uninstall();
double startTime = monotonicallyIncreasingTime();
+ int64_t processMemory = processMemoryUsage();
releaseMemory(critical, synchronous);
- unsigned holdOffTime = (monotonicallyIncreasingTime() - startTime) * s_holdOffMultiplier;
+ int64_t bytesFreed = processMemory - processMemoryUsage();
+ unsigned holdOffTime = s_maximumHoldOffTime;
+ if (bytesFreed > 0 && static_cast<size_t>(bytesFreed) >= s_minimumBytesFreedToUseMinimumHoldOffTime)
+ holdOffTime = (monotonicallyIncreasingTime() - startTime) * s_holdOffMultiplier;
holdOff(std::max(holdOffTime, s_minimumHoldOffTime));
}
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes