WebKit should throttle memory pressure notifications in proportion to handler time
authormsaboff@apple.com <msaboff@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 2 Apr 2012 18:13:37 +0000 (18:13 +0000)
committermsaboff@apple.com <msaboff@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 2 Apr 2012 18:13:37 +0000 (18:13 +0000)
commit68d8df67b91778854951a2d891d1e012227b868e
tree25959601bc6eb0ca73b8d68fc0042e1b21a83731
parent3cf73f912da356a782a7953958285f44c2159c17
WebKit should throttle memory pressure notifications in proportion to handler time
https://bugs.webkit.org/show_bug.cgi?id=82674

Reviewed by Geoffrey Garen.

Changed the MemoryPressureHandler hold off timer to start timing after
respondToMemoryPressure runs.  The delay time is now 20 times longer than the
time it took for respondToMemoryPressure to run with a minimum of 5 seconds.
This throttles the response to low memory events in the extreme case where
we are spending most of our time paging / swapping.
This is a Mac only change.

No additional tests. This passes existing test and was verified using
manual tests on a small memory system with many websites open.

* platform/mac/MemoryPressureHandlerMac.mm:
(WebCore):
(WebCore::MemoryPressureHandler::holdOff):
(WebCore::MemoryPressureHandler::respondToMemoryPressure):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@112910 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/platform/mac/MemoryPressureHandlerMac.mm