Bug 106471 - Release FastMalloc thread caches on memory warning
Summary: Release FastMalloc thread caches on memory warning
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2013-01-09 10:31 PST by Antti Koivisto
Modified: 2013-01-09 12:12 PST (History)
11 users (show)

See Also:


Attachments
patch (11.92 KB, patch)
2013-01-09 10:41 PST, Antti Koivisto
webkit-ews: commit-queue-
Details | Formatted Diff | Diff
patch2 (11.83 KB, patch)
2013-01-09 10:57 PST, Antti Koivisto
ggaren: review+
buildbot: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Antti Koivisto 2013-01-09 10:31:01 PST
FastMalloc keeps some memory in per-thread caches (currently 2MB each). We currently flush these caches on memory warning for the main thread only. We should do it for other WebKit threads that use FastMalloc too.
Comment 1 Radar WebKit Bug Importer 2013-01-09 10:32:13 PST
<rdar://problem/12982020>
Comment 2 Antti Koivisto 2013-01-09 10:41:25 PST
Created attachment 181944 [details]
patch
Comment 3 Early Warning System Bot 2013-01-09 10:46:44 PST
Comment on attachment 181944 [details]
patch

Attachment 181944 [details] did not pass qt-ews (qt):
Output: http://queues.webkit.org/results/15761561
Comment 4 Early Warning System Bot 2013-01-09 10:47:03 PST
Comment on attachment 181944 [details]
patch

Attachment 181944 [details] did not pass qt-wk2-ews (qt):
Output: http://queues.webkit.org/results/15775422
Comment 5 Antti Koivisto 2013-01-09 10:57:52 PST
Created attachment 181950 [details]
patch2
Comment 6 Geoffrey Garen 2013-01-09 11:07:44 PST
Comment on attachment 181950 [details]
patch2

I think you also want Cleanup() to call signalScavenger(). Otherwise, the memory will be in free lists in the central cache, but it won't necessarily get unmapped.
Comment 7 Build Bot 2013-01-09 11:34:27 PST
Comment on attachment 181950 [details]
patch2

Attachment 181950 [details] did not pass win-ews (win):
Output: http://queues.webkit.org/results/15760567
Comment 8 Antti Koivisto 2013-01-09 12:10:11 PST
http://trac.webkit.org/changeset/139218
Comment 9 Antti Koivisto 2013-01-09 12:12:20 PST
(In reply to comment #6)
> (From update of attachment 181950 [details])
> I think you also want Cleanup() to call signalScavenger(). Otherwise, the memory will be in free lists in the central cache, but it won't necessarily get unmapped.

That shouldn't be necessary. On memory warning we forcibly free the memory in central cache afterwards. Under normal circumstances just returning the spans should do sufficient amount of tickling.