Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

Commit be0d8b9

Browse files
committed
Bug 1284651. Allow the image surface cache to grow beyond 1GB on 64bit builds with sufficient memory. r=aosmond
Before this patch: surface cache size = min(1GB, system_memory/4) After this patch: surface cache size = min(32bit ? 1GB : 2GB , system_memory/4) sizeof(uintptr_t) is the best I can figure out to detect 32bit builds. Differential Revision: https://phabricator.services.mozilla.com/D45092 --HG-- extra : moz-landing-system : lando
1 parent 85b6f0a commit be0d8b9

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

image/SurfaceCache.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1391,6 +1391,11 @@ void SurfaceCache::Initialize() {
13911391
uint64_t surfaceCacheMaxSizeKB =
13921392
StaticPrefs::image_mem_surfacecache_max_size_kb_AtStartup();
13931393

1394+
if (sizeof(uintptr_t) <= 4) {
1395+
// Limit surface cache to 1 GB if our address space is 32 bit.
1396+
surfaceCacheMaxSizeKB = 1024 * 1024;
1397+
}
1398+
13941399
// A knob determining the actual size of the surface cache. Currently the
13951400
// cache is (size of main memory) / (surface cache size factor) KB
13961401
// or (surface cache max size) KB, whichever is smaller. The formula

modules/libpref/init/StaticPrefList.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3739,7 +3739,7 @@
37393739
# Maximum size for the surface cache, in kilobytes.
37403740
- name: image.mem.surfacecache.max_size_kb
37413741
type: uint32_t
3742-
value: 1024 * 1024
3742+
value: 2024 * 1024
37433743
mirror: once
37443744

37453745
# Minimum timeout for expiring unused images from the surface cache, in

0 commit comments

Comments
 (0)