Fixed a portion of:
authorggaren@apple.com <ggaren@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 16 Mar 2010 02:21:30 +0000 (02:21 +0000)
committerggaren@apple.com <ggaren@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 16 Mar 2010 02:21:30 +0000 (02:21 +0000)
commit38025cf06eae8983cab006e96977ce99154a2903
tree7d368757923b3d891fc231a0f37f70f5da39390d
parentf033b2be950a4af36a7f96d0e6e25ba61540fc3a
Fixed a portion of:
<rdar://problem/7165917> | https://bugs.webkit.org/show_bug.cgi?id=28676
Safari 4 does not release memory back to the operating system fast enough (28676)

Reviewed by Sam Weinig.

Every few seconds, release a percentage of the minimum unused page count
during that time period.

SunSpider reports no change, command-line or in-browser, Mac or Windows.

* wtf/FastMalloc.cpp:
(WTF::TCMalloc_PageHeap::init):
(WTF::TCMalloc_PageHeap::signalScavenger):
(WTF::TCMalloc_PageHeap::initializeScavenger): Renamed shouldContinueScavenging
to shouldScavenge, since scavenging is no longer something that we interrupt.

(WTF::TCMalloc_PageHeap::scavenge): The new scavenging algorithm. Fixes
a bug where the old code would release only one item from each size class
per scavenge, potentially leaving large numbers of large-sized objects
unreleased for a long time.

(WTF::TCMalloc_PageHeap::shouldScavenge):
(WTF::TCMalloc_PageHeap::New):
(WTF::TCMalloc_PageHeap::AllocLarge):
(WTF::TCMalloc_PageHeap::Delete):
(WTF::TCMalloc_PageHeap::GrowHeap):
(WTF::TCMalloc_PageHeap::scavengerThread):
(WTF::TCMalloc_PageHeap::periodicScavenge): Updated to track the minimum
value of free_committed_pages_ during a given scavenge period.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@56028 268f45cc-cd09-0410-ab3c-d52691b4dbfc
JavaScriptCore/ChangeLog
JavaScriptCore/wtf/FastMalloc.cpp