I see here that loading / parsing data from a file and creating a cache causes some time delay, and you want to save time from this every time.
In this case, I suggest you use EHcache . EHcache (which is open source and apache source) will support cahce for you, prevent your application from making memory errors, and save cahce state on disk.
Thus, the next time you download your application, you can configure the application to directly download from the EHcahce data file, so this way you will not parse your file again and again.
You can still load everything you use in memory, only the difference is loaded, although the EHCache APIs.
source share