CLDR Ticket #10186(accepted tools)
Investigate interning strings
|Reported by:||mark||Owned by:||mark|
We construct strings all the time in the survey tool. Many of these are persistent across the life of the survey tool, and we could probably reduce the memory footprint substantially by interning them. We should investigate these, since the memory footprint will correspond to both speed and reliability.
I suggest having a common Intern class to manage this. While investigating, have this class have a set of environment flags that we can use to switch interning on or off on a fine-grained manner, then try the ST under different configurations to look at memory usage.
We already intern the following:
- Element names (XPathParts,...)
- Starred paths
- DtdData element/attribute names
- GenerateBirths paths
- CheckCldr.Options keys
- All distinguished paths
- Constructed paths in XMLSource
- All paths that go into CLDR files (superset of above)
- Attribute names (XPathParts,...)
- Attribute values??
- Any key that we are already caching.
- we don't want to intern items that are not persistent across the life of the ST; that has the contrary effect of using up memory for no purpose.
- we should use a common interning (String.intern for strings); otherwise we are again wasting memory.
- Status changed from new to accepted
- Component changed from unknown to util
- Priority changed from assess to medium
- Phase changed from dsub to rc
- Milestone changed from UNSCH to upcoming
- Owner changed from anybody to mark
- Type changed from unknown to tools