I just started using the Memory Analyzer Tool (MAT) to see if I can optimize my Android app. It displays weather data obtained from XML files from the internet. I’m seeing a large number of Duplicate Strings because of the obvious repeat of certain weather-related strings (“clear”, “partly cloudy”, etc.).
What would be the most efficient way to reduce memory overhead with such similar strings? Enumerate the most common strings and match them during the XML parse operation?
thanks.
You can use String.intern().
But I doubt you can reduce memory footprint by removing duplicate strings