Closed Bug 46712 Opened 24 years ago Closed 24 years ago

string bundle memory flushing

Categories

(Core :: Internationalization, defect, P3)

All
Other
defect

Tracking

()

VERIFIED FIXED

People

(Reporter: warrensomebody, Assigned: alecf)

Details

(Keywords: memory-footprint, Whiteboard: [nsbeta3+])

Attachments

(2 files)

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: warren@netscape.com
  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.
Keywords: footprint, nsbeta3
Whiteboard: [nsbeta3+]
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?
Assignee: warren → alecf
oops, re-add warren to CC
Status: NEW → ASSIGNED
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.
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
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Verified.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: