[webkit-reviews] review requested: [Bug 27236] Memory is not released back to the system from TCMalloc on Windows : [Attachment 32677] This patch implements TCMalloc_SystemRelease() on windows and adds a new mechanism to release memory back to the system via a background thread.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Jul 13 13:57:34 PDT 2009


Ada Chan <adachan at apple.com> has asked	for review:
Bug 27236: Memory is not released back to the system from TCMalloc on Windows
https://bugs.webkit.org/show_bug.cgi?id=27236

Attachment 32677: This patch implements TCMalloc_SystemRelease() on windows and
adds a new mechanism to release memory back to the system via a background
thread.
https://bugs.webkit.org/attachment.cgi?id=32677&action=review

------- Additional Comments from Ada Chan <adachan at apple.com>
This patch implements TCMalloc_SystemRelease() on windows and adds a new
mechanism to release memory back to the system via a background thread.  That
new mechanism is turned on by default.	

Every 5 seconds, the background thread wakes up and does the following:
- Check if the number of pages allocated in the last 5 seconds is greater than
1/3 of the free committed pages.  If so, skip this scavenge because it's a sign
that there is a lot of activity going on right now and thrashing may happen if
we release memory back to the system now.
- Otherwise, go through the list of free spans (from largest to smallest) and
release up to 1/3 of the free committed pages back to the system.  We can
release more if there's absolutely no activity going on in the last 5 seconds.
- If the number of free committed pages reaches kMinimumFreeCommittedPageCount,
we can stop the scavenging and block the scavenging thread until the number of
free committed pages goes above kMinimumFreeCommittedPageCount.


More information about the webkit-reviews mailing list