Log number of bytes reclaimed at each step of memory pressure relief.
[WebKit-https.git] / Source / WebCore / platform / MemoryPressureHandler.h
index 17b83a9..5803531 100644 (file)
@@ -70,6 +70,27 @@ public:
     void respondToMemoryPressureIfNeeded();
 #endif
 
+    class ReliefLogger {
+    public:
+        explicit ReliefLogger(const char *log)
+            : m_logString(log)
+            , m_initialMemory(platformMemoryUsage())
+        {
+        }
+
+        ~ReliefLogger()
+        {
+            platformLog();
+        }
+
+    private:
+        size_t platformMemoryUsage();
+        void platformLog();
+
+        const char* m_logString;
+        size_t m_initialMemory;
+};
+
 private:
     void uninstall();