[WK2][NetworkCache] New entry bodies remain in dirty memory after being written to...
authorakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 22 Sep 2015 17:48:28 +0000 (17:48 +0000)
committerakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 22 Sep 2015 17:48:28 +0000 (17:48 +0000)
commit5913d02fd540eb4adca5562b0fdb59bd6358b1d8
tree84ca3653a03848d3e2b676e2a94f32d2faff5fc6
parent7382c4f1091c03820e386b421721016e3926719c
[WK2][NetworkCache] New entry bodies remain in dirty memory after being written to disk.
<https://webkit.org/b/149463>

Reviewed by Antti Koivisto.

Call msync(MS_ASYNC) on cache entry bodies after writing their data to a
memory-mapped file. This turns the previously dirty memory into clean memory,
reducing our effective footprint.

I previously believed this would happen automatically when the kernel finds
itself under memory pressure, around the same time as it starts dropping
volatile pages. Turns out that's not the case. Even under considerable pressure,
we never flush this memory to file. So let's take care of it ourselves.

If this ends up generating more IO activity than we're comfortable with on some
scenario, we can look at throttling.

* NetworkProcess/cache/NetworkCacheData.cpp:
(WebKit::NetworkCache::Data::mapToFile):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@190121 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit2/ChangeLog
Source/WebKit2/NetworkProcess/cache/NetworkCacheData.cpp