Changeset 295192 in webkit
- Timestamp:
- Jun 2, 2022, 11:45:51 PM (4 years ago)
- Location:
- branches/safari-613-branch/Source/WTF
- Files:
-
- 2 edited
-
ChangeLog (modified) (1 diff)
-
wtf/MemoryPressureHandler.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/safari-613-branch/Source/WTF/ChangeLog
r295174 r295192 50 50 (WTF::WorkQueue::assertIsCurrent const): 51 51 (WTF::currentSequenceID): 52 2022-05-13 Ben Nham <nham@apple.com> 53 54 Enforce foreground WebContent memory limit on macOS 55 https://bugs.webkit.org/show_bug.cgi?id=240397 56 57 Reviewed by Chris Dumez. 58 59 We removed the foreground memory limit for WebContent on macOS in r272046. But based on some 60 bug reports that we've seen, it seems like we need to restore some limit to prevent bad user 61 outcomes when a misbehaving process has runaway memory usage. 62 63 This patch adds a foreground memory limit of 8GB or 16GB depending on RAM size. This matches 64 the limits set by other browsers for their content process. 65 66 * wtf/MemoryPressureHandler.cpp: 67 (WTF::thresholdForMemoryKillOfActiveProcess): 68 (WTF::MemoryPressureHandler::thresholdForMemoryKill): 69 52 70 * wtf/generic/WorkQueueGeneric.cpp: 53 71 (WTF::WorkQueueBase::platformInitialize): -
branches/safari-613-branch/Source/WTF/wtf/MemoryPressureHandler.cpp
r285648 r295192 96 96 #endif 97 97 98 static size_t thresholdForMemoryKillOfActiveProcess(unsigned tabCount) 99 { 100 size_t baseThreshold = ramSize() > 16 * GB ? 15 * GB : 7 * GB; 101 return baseThreshold + tabCount * GB; 102 } 103 98 104 static size_t thresholdForMemoryKillOfInactiveProcess(unsigned tabCount) 99 105 { … … 122 128 return thresholdForMemoryKillOfInactiveProcess(m_pageCount); 123 129 case WebsamProcessState::Active: 124 break;130 return thresholdForMemoryKillOfActiveProcess(m_pageCount); 125 131 } 126 132 return std::nullopt;
Note:
See TracChangeset
for help on using the changeset viewer.