coder
coder

Reputation: 10520

sqlite database memory issue

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!

Upvotes: 0

Views: 850

Answers (2)

Adnan
Adnan

Reputation: 11

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.

Upvotes: 1

Femaref
Femaref

Reputation: 61437

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

Upvotes: 4

Related Questions