exposure.db takes up huge amounts of space
See original GitHub issueAfter less than a week of exposure tracking (and less than 1000 collected IDs total), my phone is now unusable because microG used up all of the free space on the internal storage. By far the biggest part of this is /data/data/com.google.android.gms/databases/exposure.db
, which takes 952M.
I am not sure what microG is doing there, but 1MB per ID seems like a huge amount of storage for a short string, some timestamps and signal strength, which should all easily fit in 1KB. I will probably have to disable exposure tracking because if there is no way to compress this a bit.
The entire storage partition on my phone has 5GB (out of 8GB total internal storage), so a single app consuming 1GB is way over the top… even Signal, which is notorious for how much space it needs, is at ~600MB.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:7
- Comments:42 (7 by maintainers)
I just uploaded a new build to https://microg.org/dl/core-en.apk which now includes the commits 1deeb45834c89bca10c2578a64b543ac240a83f4 and 0eb75ba363be06ae2519953dc8edf0647c98a731 which hopefully solve issues with large database files needing even more storage to be cleaned up and thus fail to do so. The database migration still needs a few MB of available storage, but afterwards you should end up with less than 10MB database size 😃
Current git already contains a fix for this problem, which seems to mostly affect “slower” devices and probably also only the German CWA.
The problem seems to be caused by CWA stopping and restarting risk calculation after 1 minute which may be too short on some devices, Google has a rate limit to make sure there are not too many risk calculation requests per day, but microG currently does not enforce this rate limit, assuming devs would have taken care of not doing to many requests already. CWA devs announced to increase the timeout to 3 minutes in v1.4.0 (due next week) and to further look into this issue for v1.5.0.
You can try a version built from git master from here: https://microg.org/dl/core-en.apk Note that if your database is already very large, it may take a few minutes after installation to start collecting ids as it has to clean up the database. On a test device Fairphone 2 this took about 7-10 minutes for a ~5GB database file.