https://bugs.webkit.org/show_bug.cgi?id=170042
<rdar://problem/
31038445>
Reviewed by Antti Koivisto.
Source/WebCore:
Prevent PerformanceMonitor from marking the process as inactive at startup.
This fixes the API test failure that caused this patch to get rolled out.
* page/PerformanceMonitor.h:
Source/WTF:
Once a web process becomes inactive, let's try to reduce its impact
on memory usage by treating it as if it's under memory pressure until
it becomes active.
* wtf/MemoryPressureHandler.cpp:
(WTF::MemoryPressureHandler::setProcessState):
(WTF::MemoryPressureHandler::isUnderMemoryPressure):
* wtf/MemoryPressureHandler.h:
(WTF::MemoryPressureHandler::isUnderMemoryPressure): Deleted.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@214974
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2017-04-05 Andreas Kling <akling@apple.com>
+
+ Make inactive web processes behave as though under memory pressure.
+ https://bugs.webkit.org/show_bug.cgi?id=170042
+ <rdar://problem/31038445>
+
+ Reviewed by Antti Koivisto.
+
+ Once a web process becomes inactive, let's try to reduce its impact
+ on memory usage by treating it as if it's under memory pressure until
+ it becomes active.
+
+ * wtf/MemoryPressureHandler.cpp:
+ (WTF::MemoryPressureHandler::setProcessState):
+ (WTF::MemoryPressureHandler::isUnderMemoryPressure):
+ * wtf/MemoryPressureHandler.h:
+ (WTF::MemoryPressureHandler::isUnderMemoryPressure): Deleted.
+
2017-04-05 Yusuke Suzuki <utatane.tea@gmail.com>
[JSC] Suppress warnings in GCC
if (m_processState == state)
return;
m_processState = state;
+ memoryPressureStatusChanged();
+ if (m_processState == WebsamProcessState::Inactive)
+ respondToMemoryPressure(Critical::Yes, Synchronous::No);
}
void MemoryPressureHandler::beginSimulatedMemoryPressure()
memoryPressureStatusChanged();
}
+bool MemoryPressureHandler::isUnderMemoryPressure()
+{
+ auto& memoryPressureHandler = singleton();
+ return memoryPressureHandler.m_underMemoryPressure
+#if PLATFORM(MAC)
+ || memoryPressureHandler.m_memoryUsagePolicy >= MemoryUsagePolicy::Strict
+ || memoryPressureHandler.m_processState == WebsamProcessState::Inactive
+#endif
+ || memoryPressureHandler.m_isSimulatingMemoryPressure;
+}
+
void MemoryPressureHandler::releaseMemory(Critical critical, Synchronous synchronous)
{
if (!m_lowMemoryHandler)
m_lowMemoryHandler = WTFMove(handler);
}
- bool isUnderMemoryPressure() const
- {
- return m_underMemoryPressure
-#if PLATFORM(MAC)
- || m_memoryUsagePolicy >= MemoryUsagePolicy::Strict
-#endif
- || m_isSimulatingMemoryPressure;
- }
+ WTF_EXPORT_PRIVATE static bool isUnderMemoryPressure();
void setUnderMemoryPressure(bool);
#if OS(LINUX)
};
#endif
- WebsamProcessState m_processState { WebsamProcessState::Inactive };
+ WebsamProcessState m_processState { WebsamProcessState::Active };
bool m_installed { false };
LowMemoryHandler m_lowMemoryHandler;
+2017-04-05 Andreas Kling <akling@apple.com>
+
+ Make inactive web processes behave as though under memory pressure.
+ https://bugs.webkit.org/show_bug.cgi?id=170042
+ <rdar://problem/31038445>
+
+ Reviewed by Antti Koivisto.
+
+ Prevent PerformanceMonitor from marking the process as inactive at startup.
+ This fixes the API test failure that caused this patch to get rolled out.
+
+ * page/PerformanceMonitor.h:
+
2017-04-05 Youenn Fablet <youenn@apple.com>
Switch to kCVPixelFormatType_420YpCbCr8BiPlanarFullRange for Mac video capture format
Timer m_postBackgroundingMemoryUsageTimer;
Timer m_processMayBecomeInactiveTimer;
- bool m_processMayBecomeInactive { true };
+ bool m_processMayBecomeInactive { false };
};
}