From the footprint meeting 7/26/00: 9) String bundles Description: StringKeys used by string bundle hashtables have showed up fairly high on the bloatblame list. Each StringKey holds an AutoString which seems wasteful for the keys in the hashtable itself (the AutoStrings are useful during lookup when the key is stack allocated). We need to reduce the size of StringKeys. Also, could string bundles be arena allocated? Module owner: ? Task owner: firstname.lastname@example.org Status: Warren to look into alternatives for StringKeys and string bundle allocation. [The hashtable/nsStringKey issue is bug 46711] Maybe string bundles can utilize arenas to save space/time.
I use an arena for the string bundle cache, though not for the string bundle itself... In order to fix bug 46491, I needed to expose a flushBundleCache() on the string bundle service, so that chrome could explicitly flush the string bundle cache when the locale changes. I'm almost done with this in my tree..
this patch removes the dependancy on chrome, and adds the flush API. Now going to fix chrome so that it calls this. I'm going to reassign to me since I'm fixing two bugs at the same time - this one and the dependancy issue. warren/tao - care to review this so I can checkin this first patch?
oops, re-add warren to CC
Hiding comments from me?... :-) Anyway, there are 2 issues here: 1. We should remove the ConvertChromeURL stuff from string bundles. Once we do that, the chrome protocol will need to call your flushBundleCache routine when it switches locales. 2. In low-memory situations, we want to have a memory flusher registered with nsIMemory that calls flushBundleCache. Can you add that while you're at it? Thanks. Patch looks good.
Created attachment 12353 [details] [diff] [review] new patch - register as a memory pressure observer as well
Will do. Patch attached which does that too..
I don't see nsIMemoryPressureObserver in the patch.
ugh, I must have attached the same patch twice
ok, fix is in.. string bundles are now flushed - when nsMemory tells us to free up memory - when the locale switches
oops, actually marking fixed