Changeset 203149 in webkit
- Timestamp:
- Jul 12, 2016, 9:05:06 PM (10 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
-
ChangeLog (modified) (1 diff)
-
platform/MemoryPressureHandler.h (modified) (1 diff)
-
platform/cocoa/MemoryPressureHandlerCocoa.mm (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r203146 r203149 1 2016-07-12 Andreas Kling <akling@apple.com> 2 3 [Cocoa] Simulated memory warning doesn't trigger libcache purge. 4 <https://webkit.org/b/159688> 5 6 Reviewed by Chris Dumez. 7 8 Since simulated memory warnings will have the "is under memory pressure" flag set, 9 we were skipping the libcache purge call. 10 11 Add a separate flag that tracks whether we're under simulated pressure, and always 12 prod libcache in that case. 13 14 * platform/MemoryPressureHandler.h: 15 * platform/cocoa/MemoryPressureHandlerCocoa.mm: 16 (WebCore::MemoryPressureHandler::platformReleaseMemory): 17 (WebCore::MemoryPressureHandler::install): 18 1 19 2016-07-12 Gyuyoung Kim <gyuyoung.kim@webkit.org> 2 20 -
trunk/Source/WebCore/platform/MemoryPressureHandler.h
r202166 r203149 144 144 145 145 std::atomic<bool> m_underMemoryPressure; 146 bool m_isSimulatedMemoryPressure { false }; 146 147 147 148 #if PLATFORM(IOS) -
trunk/Source/WebCore/platform/cocoa/MemoryPressureHandlerCocoa.mm
r202090 r203149 80 80 #endif 81 81 82 if (critical == Critical::Yes && !isUnderMemoryPressure()) {82 if (critical == Critical::Yes && (!isUnderMemoryPressure() || m_isSimulatedMemoryPressure)) { 83 83 // libcache listens to OS memory notifications, but for process suspension 84 84 // or memory pressure simulation, we need to prod it manually: … … 140 140 // Allow simulation of memory pressure with "notifyutil -p org.WebKit.lowMemory" 141 141 notify_register_dispatch("org.WebKit.lowMemory", &_notifyToken, dispatch_get_main_queue(), ^(int) { 142 m_isSimulatedMemoryPressure = true; 143 142 144 #if ENABLE(FMW_FOOTPRINT_COMPARISON) 143 145 auto footprintBefore = pagesPerVMTag(); … … 161 163 dispatch_async(dispatch_get_main_queue(), ^{ 162 164 MemoryPressureHandler::singleton().setUnderMemoryPressure(wasUnderMemoryPressure); 165 m_isSimulatedMemoryPressure = false; 163 166 }); 164 167 });
Note:
See TracChangeset
for help on using the changeset viewer.