Skip to content

Commit

Permalink
Merge r220963 - MemoryCache::setCapacities assertion failure maxDeadB…
Browse files Browse the repository at this point in the history
…ytes <= totalBytes

https://bugs.webkit.org/show_bug.cgi?id=175571

Patch by Charlie Turner <cturner@igalia.com> on 2017-08-21
Reviewed by Antti Koivisto.

* Shared/CacheModel.cpp:
(WebKit::calculateMemoryCacheSizes): Ensure cacheTotalCapacity is
set to a reasonable value even in low-memory environments.
  • Loading branch information
charlie-ht authored and carlosgcampos committed Aug 28, 2017
1 parent 57ed198 commit 3f23bc7
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Source/WebKit/ChangeLog
@@ -1,3 +1,14 @@
2017-08-21 Charlie Turner <cturner@igalia.com>

MemoryCache::setCapacities assertion failure maxDeadBytes <= totalBytes
https://bugs.webkit.org/show_bug.cgi?id=175571

Reviewed by Antti Koivisto.

* Shared/CacheModel.cpp:
(WebKit::calculateMemoryCacheSizes): Ensure cacheTotalCapacity is
set to a reasonable value even in low-memory environments.

2017-08-18 Chris Dumez <cdumez@apple.com>

REGRESSION (r220601): Crash when closing google doc after switching the order of tabs in safari
Expand Down
6 changes: 6 additions & 0 deletions Source/WebKit/Shared/CacheModel.cpp
Expand Up @@ -51,6 +51,8 @@ void calculateMemoryCacheSizes(CacheModel cacheModel, unsigned& cacheTotalCapaci
cacheTotalCapacity = 32 * MB;
else if (memorySize >= 512)
cacheTotalCapacity = 16 * MB;
else
cacheTotalCapacity = 8 * MB;

cacheMinDeadCapacity = 0;
cacheMaxDeadCapacity = 0;
Expand All @@ -75,6 +77,8 @@ void calculateMemoryCacheSizes(CacheModel cacheModel, unsigned& cacheTotalCapaci
cacheTotalCapacity = 32 * MB;
else if (memorySize >= 512)
cacheTotalCapacity = 16 * MB;
else
cacheTotalCapacity = 8 * MB;

cacheMinDeadCapacity = cacheTotalCapacity / 8;
cacheMaxDeadCapacity = cacheTotalCapacity / 4;
Expand Down Expand Up @@ -102,6 +106,8 @@ void calculateMemoryCacheSizes(CacheModel cacheModel, unsigned& cacheTotalCapaci
cacheTotalCapacity = 64 * MB;
else if (memorySize >= 512)
cacheTotalCapacity = 32 * MB;
else
cacheTotalCapacity = 16 * MB;

cacheMinDeadCapacity = cacheTotalCapacity / 4;
cacheMaxDeadCapacity = cacheTotalCapacity / 2;
Expand Down

0 comments on commit 3f23bc7

Please sign in to comment.