Log number of bytes reclaimed at each step of memory pressure relief.
authorakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 17 Apr 2014 19:19:58 +0000 (19:19 +0000)
committerakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 17 Apr 2014 19:19:58 +0000 (19:19 +0000)
commit282d44cd7c4523ae6e0937dda0e752299f48d715
tree8976966c3ffd8d6b47cda3b0f7f3aa37148e0ebc
parenta2f97de135a712d77f518d6da810195b785ed2fc
Log number of bytes reclaimed at each step of memory pressure relief.
<https://webkit.org/b/131751>

Reviewed by Antti Koivisto.

* platform/MemoryPressureHandler.h:
* platform/MemoryPressureHandler.cpp:
(WebCore::MemoryPressureHandler::ReliefLogger::platformLog):
(WebCore::MemoryPressureHandler::ReliefLogger::platformMemoryUsage):
(WebCore::MemoryPressureHandler::ReliefLogger::ReliefLogger):
(WebCore::MemoryPressureHandler::ReliefLogger::~ReliefLogger):
* platform/cocoa/MemoryPressureHandlerCocoa.mm:
(WebCore::MemoryPressureHandlerCocoa::ReliefLogger::platformMemoryUsage):
(WebCore::MemoryPressureHandlerCocoa::ReliefLogger::platformLog):

    Add a simple RAII helper to check memory usage before and after
    a block of code, and then dump the delta to system log.

(WebCore::MemoryPressureHandler::releaseMemory):
* platform/cocoa/MemoryPressureHandlerCocoa.mm:
(WebCore::MemoryPressureHandler::platformReleaseMemory):

    Use ReliefLogger to annotate the various attempts to reduce
    our memory footprint. This will help us understand the efficiency
    of our current strategy.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@167445 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/platform/MemoryPressureHandler.cpp
Source/WebCore/platform/MemoryPressureHandler.h
Source/WebCore/platform/cocoa/MemoryPressureHandlerCocoa.mm