0

I am trying minimize the memory usage of my sqlite database. Originally, in my Android application, the db was about 400kb, as everything worked fine. The db copied easily from the assets folder for first time users. We had to change some things about the database, and it is now about 850kb. The db does not copy from the assets folder to a device(it works on an emulator). In the new, larger db, I tried changing some of the columns that were text columns into integers and reals(when possible). This did nothing to reduce the size. Any ideas?

Thanks!

2 Answers 2

4

The Vacuum command might help. It recreates the database from scratch, eliminating fragmentation and other things bloating your database.

Sign up to request clarification or add additional context in comments.

1 Comment

Yes! That took off 400kb! Thanks.
1

In SQLite once you create a database an certain amount of memory is used. As you keep on increasing the memory it takes from the stack. But it does not free this memory, as its an feature of the SQLite to retain this memory for future use. Use Vaccum to free this memory.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.