vendredi 11 mars 2016

How to measure Android app data size and identify storage leaks?

I made a small Android app and have been using it for a while now. I noticed that, in the settings, on the data line of my app's characteristics, it shows about 20 MB, which seemed a lot to me. I am afraid the app has storage leaks.

I decided to investigate and measure what might take that much space. I use pretty much all the available storage options for this app: SQLite DB, Cache files (including Glide picture loading), internal files, external files, shared preferences.

So far, thanks to a question on SQLite DB, I found that my DB file takes about 500 kB. I found by scanning recursively the files and folders in folders getFilesDir(), getCacheDirs that Glide uses about 3 MB (close to what the Android settings app tells), and that I use 10 kB of data in internal and app-private external files. I have not analysed Shared Preferences size yet, but I store less than 20 key/value pairs.

My question is, which leads did I miss to find where this 19.5 MB of data I cannot locate? Did I forget some kind of storage that might take space? And, more generally, are there tools to analyse storage leaks?

Aucun commentaire:

Enregistrer un commentaire