Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/activity.py
diff options
context:
space:
mode:
authorChris Ball <cjb@laptop.org>2008-05-25 18:41:30 (GMT)
committer Chris Ball <cjb@laptop.org>2008-05-25 23:00:21 (GMT)
commit9c119dac63edd08194e28eefc11c88acce268acb (patch)
tree10cdadf68701f783205599220f7073ca8c5499ff /activity.py
parentbe42272c9f2222941dde40c4adc00237da63a83b (diff)
Use XPCOM to set a RAM cache limit, avoiding OOM.
Diffstat (limited to 'activity.py')
-rw-r--r--activity.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/activity.py b/activity.py
index 41f5dc7..9125e72 100644
--- a/activity.py
+++ b/activity.py
@@ -47,6 +47,13 @@ class WikipediaActivity(webactivity.WebActivity):
handle.uri = 'http://localhost:%s%s' % (HTTP_PORT, HOME_PAGE)
webactivity.WebActivity.__init__(self, handle)
+
+ # Use xpcom to set a RAM cache limit. (Trac #7081.)
+ from xpcom import components
+ cls = components.classes['@mozilla.org/preferences-service;1']
+ pref_service = cls.getService(components.interfaces.nsIPrefService)
+ branch = pref_service.getBranch("browser.cache.memory.")
+ branch.setIntPref("capacity", "5000")
self.searchtoolbar = SearchToolbar(self)
# WTB: Hacked to use hardcoded Spanish localization for WikiBrowse release.