Reduce number of platformMemoryUsage calls
authorkrollin@apple.com <krollin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 11 Nov 2016 21:50:11 +0000 (21:50 +0000)
committerkrollin@apple.com <krollin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 11 Nov 2016 21:50:11 +0000 (21:50 +0000)
commite5eb71670a0671e04138b157054516acde84bae8
treed3c332151a3c2426245e2e48a121ed1a2ac1a4b1
parent22d3267424f39dfb53f3c5ba5f3494c5cdec0a65
Reduce number of platformMemoryUsage calls
https://bugs.webkit.org/show_bug.cgi?id=164375

Reviewed by Andreas Kling.

platformMemoryUsage was being called all the time while logging the
results of various memory-purging operations. This logging is
subordinate to the needs of performance and so can be removed.
Behavior is now as follows:

- If memory-pressure relief logging is enabled, logging includes
memory usage information. On Cocoa, this logging is disabled by
default but can be enabled by setting LogMemoryJetsamDetails in
`defaults`.
- Otherwise, if release-logging is enabled (as it is on Cocoa),
abbreviated memory pressure relief logging is performed: the logging
lines are printed but without any memory usage information.
- Otherwise, no logging is performed.

No new tests -- no tests for logging.

* platform/MemoryPressureHandler.cpp:
(WebCore::MemoryPressureHandler::ReliefLogger::logMemoryUsageChange):
* platform/MemoryPressureHandler.h:
(WebCore::MemoryPressureHandler::ReliefLogger::ReliefLogger):
(WebCore::MemoryPressureHandler::ReliefLogger::~ReliefLogger):

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