My Android application uses SQLCipher for a database encryption, as per my project requirement I need to store Bitmap String in my local database which needs to get removed from the database once uploaded to the server successfully. But here I met with a very weird issue with the SQLCipher i.e. even after deleting all the image strings from table my app’s database size doesn’t decrease rather it got increased. For instance my db’s initial size was 45 KB With 30 image strings in table size became 2.91 MB And, after deleting 30 images from table size got increased to 3.04 MB
But, when I did the same case with normal SQLite database i.e. without SQLCipher encryption, I got the expected results i.e. db size 2.91 got reduced to 50 KB after deleting the images from the table.
You may want to look into performing a vacuum of the database file. Unless you have auto_vacuum enabled, deleting data from the database will leave empty space as free database pages, maintaining a similar size on disk. If that resolves your issue, you might also consider using auto_vacuum feature. Please let us know if this resolves the issue for you.
Hi guys,
is there somewhere manual how to apply/perform vacuum? We ran into similar issue when we are deleting images from database, but the database size doesn’t decrease. The problem is caused by the application database having grown to a size the app can no longer handle effectively (up to 8GB).