简体   繁体   中英

Why might data disappear from internal storage?

In my application, I save large, serialized ArrayList<HashMap<String, String>> s

There are between six and twelve strings in each hashmap. In testing, I save arrays of length two hundred at most.

An issue has arisen whereby this data goes missing in the live environment. There are no crashes reported, and I'm unable to repeat the problem myself with test data. When users attempt to view a list comprised of some of this data, it appears empty. The list is definitely saved on the phone and successfully loaded at least once, but after this does not load successfully. As far as I am aware, this only happens when a user has a large amount of data stored in this way.

Are there any limits to data size, or other knows issues, that could possibly be causing this? As I said, I find it impossible to replicate so it seems to be an issue with large arraylists or with different phone types.

Thanks for the help!

This will happen if a user is using a older device. If the application uses more than what the device can allocate it then the deice will try to free up space to keep the app running. The best thing you can do is to try to limit the size of your Array to keep memory usage low.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM