Changeset 210223 in webkit
- Timestamp:
- Jan 2, 2017 5:54:17 AM (7 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r210222 r210223 1 2017-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 1 14 2017-01-02 Chris Fleizach <cfleizach@apple.com> 2 15 -
trunk/Source/WebCore/platform/linux/MemoryPressureHandlerLinux.cpp
r209744 r210223 54 54 // s_holdOffMultiplier times the last cleanup processing time. Effectively 55 55 // 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). 56 58 // These value seems reasonable and testing verifies that it throttles frequent 57 59 // low memory events, greatly reducing CPU usage. 58 60 static const unsigned s_minimumHoldOffTime = 5; 61 static const unsigned s_maximumHoldOffTime = 30; 62 static const size_t s_minimumBytesFreedToUseMinimumHoldOffTime = 1 * MB; 59 63 static const unsigned s_holdOffMultiplier = 20; 60 64 … … 285 289 286 290 double startTime = monotonicallyIncreasingTime(); 291 int64_t processMemory = processMemoryUsage(); 287 292 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; 289 297 holdOff(std::max(holdOffTime, s_minimumHoldOffTime)); 290 298 }
Note: See TracChangeset
for help on using the changeset viewer.