How to handle duplicate lines in Android to reduce memory usage?

I just started using memory analysis tool (MAT) to find out if I can optimize my Android application. It displays weather data obtained from XML files from the Internet. I see a large number of repeated lines due to the obvious repetition of certain weather lines ("clear", "partially cloudy, etc.).

What would be the most efficient way to reduce memory overhead with the same lines? List the most common lines and match them during an XML parsing operation?

thanks.

+4
source share
1 answer

You can use String.intern () .
But I doubt that you can reduce the amount of memory by removing duplicate lines

+2
source

Source: https://habr.com/ru/post/1434667/


All Articles