Personal tools

Mobile/MemoryReduction

From MozillaWiki

Jump to: navigation, search

Contents

Reduce session history entries

user_pref("browser.sessionhistory.max_entries", 0);

Turn off bfcache

user_pref("browser.sessionhistory.max_total_viewers", 0);

Disable X image caching on Unix/Linux

An environmental variable. Set it like this:

MOZ_DISABLE_IMAGE_OPTIMIZE=1 ./firefox

It stops images from being cached on the X server on Unix/Linux. Generally hurts performance, but gives you a more predictable pixmap usage on the server.

Reduce memory cache

user_pref("browser.cache.memory.enable", false);

This turns off the cache. Probably not the best thing to do as things will get decoded more than once and you'll end up with more fragmentation according to stuart. Good to leave this at some small number instead.

user_pref("browser.cache.memory.capacity", 8192);

This sets the memory cache to 8MB, which is a good starting size. (Also the same default size as what WebKit uses.)

Reduce disk cache

user_pref("browser.cache.disk.capacity", value);

Untested. Setting this too low will break ajaxy sites.

Disable Session Store

 user_pref("browser.sessionstore.enabled", false)

Untested

jemalloc options

 MALLOC_OPTIONS=12f ./firefox

tradeoff between space and speed. not sure of the optimal value.

12f holds 0mb of free pages in jemalloc

2F is the Mozilla default and holds 8mb of free pages in jemalloc. 2f is the jemalloc default and holds 2mb free. According to stuart we probably want something in the 2-8MB range, which would be different.

12fP will print stats on exit

use system libraries

png, jpeg, zlib, bz2, all can be built using system libraries:

ac_add_options --with-system-png ac_add_options --with-system-jpeg ac_add_options --with-system-zlib ac_add_options --with-system-bz2