-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use mapped files in CacheStorageDiskStore
https://bugs.webkit.org/show_bug.cgi?id=259371 rdar://problem/112623177 Reviewed by Chris Dumez. Currently CacheStorageDiskStore reads entire files into dirty memory. When many DOMCache operations in flight, this can lead to a temporary explosion in NetworkProcess memory usage (in the gigabytes of footprint). To fix this issue, we use read-only mapped files in CacheStorageDiskStore instead, as we do with the regular network cache. This trades dirty footprint for higher vnode usage. But that should be okay as the number of vnodes consumed by DOMCache should be much lower than the number of vnodes used by NetworkCache, which is already mmap'ing everything. I also removed some unnecessary cross-thread copies, as the data we're passing across threads isn't affined to a particular thread (e.g. no non-atomic ref counts). * Source/WTF/wtf/FileSystem.h: (WTF::FileSystemImpl::MappedFileData::toSpan): (WTF::FileSystemImpl::MappedFileData::create): * Source/WebKit/NetworkProcess/storage/CacheStorageDiskStore.cpp: (WebKit::readRecordInfoFromFileData): (WebKit::CacheStorageDiskStore::readRecordFromFileData): (WebKit::CacheStorageDiskStore::readAllRecordInfosInternal): (WebKit::CacheStorageDiskStore::readAllRecordInfos): (WebKit::CacheStorageDiskStore::readRecordsInternal): (WebKit::CacheStorageDiskStore::readRecords): * Source/WebKit/NetworkProcess/storage/CacheStorageDiskStore.h: Canonical link: https://commits.webkit.org/266199@main
- Loading branch information
Showing
3 changed files
with
52 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters